Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-26 08:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found