use Mail::Sender; my $sender = new Mail::Sender {smtp => 'smtp@blah.com', from => 'emailforyou@blah.com'}; if (ref $sender->OpenMultipart({ from => 'webmaster@ci.grand-rapids.mi.us', to => $to, subject => 'mail message', boundary => 'boundary-test-1', multipart => 'related'})) { $sender->Attach( {description => 'html body', ctype => 'text/html; charset=us-ascii', encoding => '7bit', disposition => 'NONE', file => 'file.html' }); $sender->Attach({ description => 'file1.jpg', ctype => 'image/gif', encoding => 'base64', disposition => "inline; filename=\"file1.jpg\";\r\nContent-ID: ", file => 'file1.jpg' }); $sender->Attach({ description => 'logo.gif', ctype => 'image/gif', encoding => 'base64', disposition => "inline; filename=\"logo.gif\";\r\nContent-ID: ", file => 'logo.gif' }); $sender->Close() or die "Close failed! $Mail::Sender::Error\n"; } else { die "Cannot send mail: $Mail::Sender::Error\n"; }