question about mail()
Posted: Thu Feb 19, 2004 11:09 am
How do we add html tags and image files into the auto email send out using the mail() function??
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
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";
}