These examples using MIME::Entity work fine. In the first sub we have plain text, a gif and HTML. In the second we have plain text and MSWord docs. I find MIME::Entity (part of MIME::Tools reliable)

sub Respond_HTML { use MIME::Entity; # first, format the email address for MIME::ENTITY # create the top-level, and set up the mail headers: my $top = build MIME::Entity Type => 'multipart/mixed', From => $our_email, To => $email, Subject => "Information from $us"; # next, add the body of the message: attach $top Data=> "Hello $name,\n\nHere is the information you requested.\ +n\n$us \n\n"; # now add the pretty leterhead: attach $top Path => "$path_to_home_dir/Images/letterhead.gif", Type => 'image/gif', Encoding => 'base64'; # now, make attachment/s: for ($i=0 ; $i<=4; $i++ ) { if ($request[$i]) { attach $top Path => "$path_to_home_dir/Auto_Respond_Files/$HTML_file +[$i]", Type => 'text/HTML', Encoding => '7bit'; } } # finally, send it: open MAIL, "|$mail_prog -t -i" or die "open: $!"; $top->print(\*MAIL); close MAIL; return 1; } # end Respond_HTML # Send automatic msword.doc email response according to request(s) sub Respond_MSWord { use MIME::Entity; # first, format the email address for MIME::ENTITY # create the top-level, and set up the mail headers: my $top = build MIME::Entity Type => 'multipart/mixed', From => $our_email, To => $email, Subject => "Information from $us"; # next, add the body of the message: attach $top Data=> "Hello $name,\n\nHere is the information you requested.\ +n\n$us\n\n"; # now, make attachment/s: for ($i=0 ; $i<=4; $i++ ) { if ($request[$i]) { attach $top Path => "$path_to_home_dir/Auto_Respond_Files/$msword_fi +le[$i]", Type => 'application/octet-stream', Encoding => 'base64'; } } # finally, send it: open MAIL, "|$mail_prog -t -i" or die "open: $!"; $top->print(\*MAIL); close MAIL; return 1; }

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print


In reply to Re: Multi-Part email with Attachments using MIME::Lite by tachyon
in thread Multi-Part email with Attachments using MIME::Lite by filmo

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.