#!/usr/bin/perl use Mail::Sender; $sender = new Mail::Sender {smtp => 'MSEXCHANGE_SERVER_IP', from => ''}; $recipients = ""; $user = ""; $pass = ""; @protocols = $sender->QueryAuthProtocols(); $size = scalar @protocols; if($size > 0) { foreach $protocols(@protocols) { $authtype = "$protocols"; } $sender = new Mail::Sender{smtp => 'MSEXCHANGE_SERVER_IP', from => '', debug => "", debug_level => 4, auth => "$authtype", authid => "$user", authpwd => "$pass"}; if (ref $sender->OpenMultipart({ from => '', to => $recipients, subject => 'Embedded Image Test', boundary => 'boundary-test-1', multipart => 'related'})) { $sender ->Attach( {description => 'html body', ctype => 'text/html; charset=us-ascii', disposition => 'inline', file => 'file.html', }); $sender->Attach({ description => 'ed\'s 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"; } } else { }