Page 1 of 1

question about mail()

Posted: Thu Feb 19, 2004 11:09 am
by dakkonz
How do we add html tags and image files into the auto email send out using the mail() function??

Posted: Thu Feb 19, 2004 11:12 am
by ol4pr0
You want to add files like a attachement ?

Posted: Thu Feb 19, 2004 11:15 am
by dakkonz
i wanna make the email like an html page

Posted: Thu Feb 19, 2004 11:27 am
by ol4pr0
I guess in either way you should use mime for that...

Posted: Thu Feb 19, 2004 11:34 am
by ol4pr0
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";
        }

Posted: Fri Feb 20, 2004 2:29 am
by dakkonz
hey wat if i wan to include html codes like <u></u> and stuff?? what muz i put to be able to do that for the mail that is sent out??

Posted: Fri Feb 20, 2004 9:06 am
by ol4pr0