Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to send an Excel file via perl. With following code, I can send the file, but "my_message" is never get printed and the Excel file' cannot be opened. (It gives some bogus cannot access/read-only file error messages)
use MIME::Entity; use Mail::Send; @my_message = qw(Hello world Look at my attachment); $msg = MIME::Entity->build(From => 'me@myhost.com', Type => "multipart/mixed", To => 'user@company.com', Subject => "Hello, ! ", Data => \@my_message); $msg->attach(Path => 'account.xls', Encoding => '-SUGGEST', Disposition => "attachment", '-X-Mailer' => undef, ); open SENDMAIL, "|/usr/lib/sendmail -t" or die $!; $msg->print(\*SENDMAIL); close SENDMAIL;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Mail Attachment.
by barrd (Canon) on Dec 15, 2003 at 17:56 UTC | |
|
Re: Mail Attachment.
by zentara (Cardinal) on Dec 15, 2003 at 17:40 UTC |