in reply to Attach a file to email
This link to CPAN will give you lots more info, too.use MIME::Lite; my $msg = MIME::Lite->new ( From => 'you@somewhere.com', To => 'someone@somewhere.com', Subject => 'A subject line', Type => 'multipart/mixed'); $msg->attach( Type => 'TEXT', Data => 'Normal text of the email' ); # open a file to send open FILE "file.zip"; my $data = <FILE>; close FILE; $msg->attach( Type => 'BINARY', # or any MIME type you like Data => '$data', Filename => 'file.zip' ); $msg->send;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Attach a file to email
by rtoma (Initiate) on Nov 14, 2001 at 06:45 UTC |