question about mail()
Moderator: General Moderators
question about mail()
How do we add html tags and image files into the auto email send out using the mail() function??
however consider the following, ofcourse you will need to edit this according to youre own needs and script language 
Code: Select all
if (ref $sender->OpenMultipart({
from => 'someone@somewhere.net', to => $recipients,
subject => 'Embedded Image Test',
boundary => 'boundary-test-1',
multipart => 'related'})) {
$sender->Attach(
{description => 'html body',
ctype => 'text/html; charset=us-ascii',
encoding => '7bit',
disposition => 'NONE',
file => 'test.html'
});
$sender->Attach({
description => 'ed''s gif',
ctype => 'image/gif',
encoding => 'base64',
disposition => "inline; filename="apache_pb.gif";\r\nContent-ID: <img1>",
file => 'apache_pb.gif'
});
$sender->Close() or die "Close failed! $Mail::Sender::Error\n";
} else {
die "Cannot send mail: $Mail::Sender::Error\n";
}