Hey everyone. I have a problem with MIME::Lite I'm hoping someone can help me with. Searched Google, here, asked on IRC, no one seems to have the problem much less the solution :).

I'm using MIME::Lite, I've used it extensively in the past without a problem, but now on a particular program, it seems to ignore the From header that I specify and instead show my messages as coming from 'nobody@myserver.com'

Here's the code, almost the same as the docs with just some minor differences for my own variables

my $msg = MIME::Lite->new( From =>$CONFIG{submit_by}, To =>$CONFIG{submit_to}, Subject =>$CONFIG{subject}, Type =>'TEXT', Data =>$message, ); if($CONFIG{SENDMAIL}) { MIME::Lite->send("sendmail","$CONFIG{SENDMAIL} -t"); } elsif($CONFIG{SMTP_SERVER}) { MIME::Lite->send("smtp",$CONFIG{SMTP_SERVER},Timeout=>30); } else { # Yikes! No send method specified. Abort croak "No send method specified.\n"; } $msg->send();

I've verified that my %CONFIG has the information it needs to work including an email address in the 'submit_by' but all the messages I receive from it have 'nobody' as the sender. I've tried sending this both through my sendmail installation and through a remote SMTP server (postfix) with the same results. Anyone have any ideas?

Thanks


In reply to MIME::Lite From header problem by cfreak

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.