question about mail()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dakkonz
Forum Commoner
Posts: 69
Joined: Sat Dec 27, 2003 2:55 am
Location: Asia

question about mail()

Post by dakkonz »

How do we add html tags and image files into the auto email send out using the mail() function??
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

Post by ol4pr0 »

You want to add files like a attachement ?
dakkonz
Forum Commoner
Posts: 69
Joined: Sat Dec 27, 2003 2:55 am
Location: Asia

Post by dakkonz »

i wanna make the email like an html page
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

Post by ol4pr0 »

I guess in either way you should use mime for that...
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

Post 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";
        }
dakkonz
Forum Commoner
Posts: 69
Joined: Sat Dec 27, 2003 2:55 am
Location: Asia

Post 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??
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

Post by ol4pr0 »

Post Reply