Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^5: Trouble emailing zip file

by Paladin (Vicar)
on Jul 04, 2018 at 23:08 UTC ( [id://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 making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-25 07:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found