the message just seems to go into cyberspace and not my inbox?
Does mailx work when you run it from the command line? If not, then maybe your mail system isn't configured properly? Have you checked your system's logs and checked your mailbox for bounced mails? If mailx does work from the command line, then note that you need to check the return value of system for errors - see its docs, but the bare minimum is system(...)==0 or die "\$?=$?";
I've put the curly braces around the variables to try to avoid interpolation
Sorry, that's not how that works, "${foo}" is just another way of writing "$foo". The best way to avoid interpolation is to use the form of system that does not call the shell, where you give system a list of arguments with more than one element. But if you don't go through the shell, you also won't get pipe I/O redirection, which you could solve by a two-step process where the file is first encoded into a temporary file (File::Temp). Or, you could use a module like IPC::Run, which supports I/O redirection. I wrote about this whole topic at length here.
However, I'd strongly recommend against shelling out in the first place. See Email::Stuffer, here's something adapted from its Synopsis:
use Email::Stuffer; Email::Stuffer->from('sender@example.com') ->to('user01@email.org')->subject("logs for $pkgname") ->text_body('Here's the log file.') ->attach_file("$logpath.zip") ->send;
In reply to Re: Trouble emailing zip file
by haukex
in thread Trouble emailing zip file
by TonyNY
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |