in reply to Re: Re: Re: Multi-Part email with Attachments using MIME::Lite
in thread Multi-Part email with Attachments using MIME::Lite
Here's the modified code
This builds a "correctly" nested e-mail.$email_msg = MIME::Lite->new ( Return-Path =>$from, From =>$from, To =>$email_to, Subject =>"Completed Transcripts ($count_trans +attached)", Type =>'multipart/mixed', Encoding =>'7bit' ); if ($cc_email) {$email_msg->add(CC =>$cc_email)} # Build Part 2 which is 'multipart/alternative' $body = MIME::Lite->new ( Type =>'multipart/alternative', Encoding =>'7bit', ); # Here's the fallback plain text message $body->attach( Type =>'text/plain', Encoding =>'7bit', Data =>$plain ); # Here's the HTML, nicely formated e-mail message + $body->attach( Type =>'text/html', Encoding =>'7bit', Data =>$html_body, ); # Attach the "body" part to the original message $email_msg->attach($body); # Attach "attachments" to original message foreach $file (sort keys %file_attach) { $email_msg->attach (Type =>'application/msword', Path =>$file_attach{$file}, Filename=>$file, Disposition=>'attachment', Encoding =>'base64' ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: Multi-Part email with Attachments using MIME::Lite
by tachyon (Chancellor) on Aug 16, 2001 at 07:15 UTC |