Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^5: Trouble emailing zip file

by Paladin (Vicar)
on Jul 04, 2018 at 23:08 UTC ( #1217917=note: print w/replies, xml ) Need Help??


in reply to Re^4: Trouble emailing zip file
in thread Trouble emailing zip file

When using the LIST form of system() the first argument is the program to run, the rest of the arguments are the parameters for the program. I can almost guarantee you don't have a program called /usr/bin/mailx uuencode $zipfile $zipfile -r -s on your system. You probably have /usr/bin/mailx however. The other parts (uuencode $zipfile $zipfile -r -s) need to be passed as parameters to mailx.
my @emailcmd = ('/usr/bin/mailx', 'uuencode', $zipfile, $zipfile, '-r' +, '-s'); #and later my @args = (@emailcmd, $subject, $recipient); system(@args) == 0 or die "system @args failed: $?";

This is of course assuming that the command /usr/bin/mailx uuencode file.zip file.zip -r -s Subject Recipient indeed works on the command line.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1217917]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2023-12-10 16:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (40 votes). Check out past polls.

    Notices?