i'm not an extensive user of MIME::Lite, but i have a couple of thoughts...
  1. Are you sure you understand what the Path & Filename parameters to attach are for? 'Path' should be the full path of your file, not just a directory name -- 'Filename' is just what label the file gets in the email.

    (I'm guessing this is your REAL problem, the rest are just alternate suggestions)

  2. In my experiments, MIME::Lite doesn't deal well with "multipart/mixed" msgs that only have 1 part, so unless you are attaching more things then you show you might try this...
    $msg = MIME::Lite->new( From =>'me@myhost.com', To =>'you@yourhost.com', Cc =>'some@other.com, some@more.com', Subject =>'Helloooooo, nurse!', Type =>'TEXT', Path =>'/your/file/name', );
  3. on my installation, MIME::Lite (v2.104) seems to be creating malformed msg headers -- putting in an extra blank line after the subject, if that's happening on your system, it's probably confusing your mail reader.
  4. you might wnat to take a look at the "ReadNow" option of $msg->attach, if there's a chance that your file is getting deleted at anypoint in your script (prior to the $msg->send() call)

In reply to Re: Using MIME::Lite in perl. by hossman
in thread Using MIME::Lite in perl. by brentheigold

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.