in reply to Re: Re: Re: Re: Multi-Part email with Attachments using MIME::Lite
in thread Multi-Part email with Attachments using MIME::Lite

Hah - I came to the same conclusion and did this:

use MIME::Entity; my $email = 'you@yours.com'; my $our_email = 'me@mine.com'; my $us = 'Just another Perl Hacker'; # create the alternative part with header my $alt = build MIME::Entity Type => 'multipart/alternative'; # now, make alternative attachment/s: attach $alt Path => "c:/text.txt", Type => 'text/HTML', Encoding => '7bit'; attach $alt Path => "c:/html.htm", Type => 'text/HTML', Encoding => '7bit'; # stringify our alternative part object $alt = $alt->as_string; # 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 alternate bodies of the message: attach $top Data => $alt; # now, make an attachment: attach $top Path => "c:/word.doc", Type => 'application/octet-stream', Encoding => 'base64'; # have a look at the result print $top->as_string;

cheers

tachyon

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

  • Comment on Re: Re: Re: Re: Re: Multi-Part email with Attachments using MIME::Lite
  • Download Code