eric256 has asked for the wisdom of the Perl Monks concerning the following question:
Using the following code I'm able to send files, but when I send an excel file it comes out the other in the right size, but excel fails to open it. I'm betting this is something obvious, but any help is appreciated. BTW This is a command line script, i just use CGI to handle command line parameters because i'm lazy and it works.
use strict; use warnings; use MIME::Lite; use CGI; my $cgi = new CGI; MIME::Lite->send('smtp', '192.168.11.203', Timeout=>60); my $to = $cgi->param("to"); my $from = $cgi->param("from"); my $subject = $cgi->param("subject"); my $text = $cgi->param("text"); my @files = ($cgi->param("files")); my $msg = MIME::Lite->new( To => $to, From => $from, Subject => $subject, Type => 'multipart/mixed', ); $msg->attach(Type => 'TEXT', Data => $text ); for my $file (@files) { $msg->attach(Id => $file, Path => $file ); } $msg->send; ### will now use Net::SMTP as shown above
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sending Email Attachment
by philcrow (Priest) on Feb 19, 2007 at 17:32 UTC | |
by eric256 (Parson) on Feb 19, 2007 at 17:43 UTC | |
by clscott (Friar) on Feb 19, 2007 at 18:59 UTC | |
by eric256 (Parson) on Feb 19, 2007 at 19:04 UTC | |
|
Re: Sending Email Attachment
by j3 (Friar) on Feb 19, 2007 at 17:44 UTC |