in reply to Re: (Ovid) Re: Bewildered in a Land of Shiny Perls
in thread Attaching an image to mail
# create message use MIME::Lite; $msg = MIME::Lite->new( From =>'me@myhost.com', To =>'you@yourhost.com', Subject =>'Helloooooo, nurse!', Type =>'image/gif', Encoding =>'base64', FH => \*UPLOAD, ); # send it using Net::SMTP my $smtp = Net::SMTP->new($mailserver); $smtp->mail ('me@myhost.com'); $smpt->to ('you@yourhost.com'); $smtp->data($msg->as_string);
See docs for relevant modules.
Update: fixed a couple of bugs and removed Cc: header from MIME message.
|
|---|