If you want to send a HTML with some inline images :
use strict;
use Mail::Sender;
my $recipients = 'somebody@somewhere.com';
my $sender = new Mail::Sender {smtp => 'your.mailhost.com'};
if ($sender->OpenMultipart({from => 'itstech2@gate.net', to => $recipients,
subject => 'Embedded Image Test', subtype => 'related',
boundary => 'boundary-test-1',
type => 'multipart/related'}) > 0) {
$sender->SendFile(
{description => 'html body',
ctype => 'text/html; charset=us-ascii',
encoding => '7bit',
disposition => 'NONE',
file => 'test.html'
});
$sender->SendFile(
{description => 'ed\'s gif',
ctype => 'image/gif',
encoding => 'base64',
disposition => "inline; filename=\"apache_pb.gif\";\r\nContent-ID: ",
file => 'apache_pb.gif'
});
$sender->Close() or die "Close failed! $Mail::Sender::Error\n";
} else {
die "Cannot send mail: $Mail::Sender::Error\n";
}
__END__
In the HTML you'll have this :
... ...