Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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
Node Status?
node history
Node Type: note [id://1217917]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2019-10-21 14:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?