BMilan has asked for the wisdom of the Perl Monks concerning the following question:
Regards, Milan#!/usr/bin/perl # # -------------------------------------------------------------------- +-- # # # Purpose: Email attachments in Perl # # -------------------------------------------------------------------- +-- use MIME::Lite; use Net::SMTP; .... .... ### Create the multipart container $msg = MIME::Lite->new ( From => $from_address, To => $to_address, Subject => $subject, Type =>'multipart/mixed' ) or die "Error creating multipart container: $!\n"; ### Add the text message part $msg->attach ( Type => 'TEXT', Data => $message_body ) or die "Error adding the text message part: $!\n"; ### Add the ZIP file $msg->attach ( Type => 'application/zip', Path => $my_file_zip, Filename => $your_file_zip, Disposition => 'attachment' ) or die "Error adding $file_zip: $!\n"; ### Send the Message MIME::Lite->send('smtp', $mail_host, Timeout=>60); $msg->send;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using MIME::Lite with TLS
by Corion (Patriarch) on Oct 14, 2009 at 07:55 UTC | |
|
Re: Using MIME::Lite with TLS
by jethro (Monsignor) on Oct 14, 2009 at 10:38 UTC | |
|
Re: Using MIME::Lite with TLS
by spx2 (Deacon) on Oct 14, 2009 at 10:38 UTC |