Re: Want to send email in html format

From: Date: Tue, 24 Apr 2001 17:18:57 +0000
Subject: Re: Want to send email in html format
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-50140@lists.php.net to get a copy of this message
Hi Geroge, you can do this: Fist: make an php document with all the content of the letter at html ex: $body .= " <html><head><title>any title</title></head> \n"; $body .= " <body bgcolor=\"#FFFFFF\" text=\"#000000\"> \n"; $body .= "<img src=\"http://your.domain.com/image/image.gif\" width=\"330\" height=\"38\"> \n"; $body .= " This is a mail at html \n"; $body .= " </body> $body .= " </html> note that the image will to be taken from your site... Second: make the php script that will send the mail: require("$body.php"); //the document that has all the html tags $email ="anymail@any.com //the mail of the person that you want to contact $topic = "any subject"; $from = "yourmail@your.domain.com"; $headers .= "From: $from \n"; $headers .= "reply-To:$from\nX-Mailer: PHP/" .phpversion()." \n"; $headers .= "Content-Type: text/html; charset=iso-8859-1\n"; $headers .= "X-Priority: 1"; @mail($email, $topic, $body, $headers); don't forget to put code next the mail() fuction or it will send you a message telling that it has no content... try it, if you have any problem, you can contact me... George Alexander wrote: > Hi, > > I am working on a newsletter module. What I want > to know is that how can we send a newsletter via > email to all the subscribers in html format > with images in the htm too??? > > Well I am able to send an html file as attachment > using the php mail() function. But I still can't > see the images in the htm file. What I think is > the mail function just sends the file as text only > and it will not pick up the images in the html file. > So is there a way that I can send the html format > with images via email. > > Please reply asap. > > regards > George > > _____________________________________________________ > Chat with your friends as soon as they come online. Get Rediff Bol at > http://bol.rediff.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net -- -------------------------------------- Romeo Manzur Web Application Developer iSilicom Av. 27 de Febrero 904-A Desp 1, Centro C.P.:86000 Villahermosa, Tabasco, Mexico Tel.:(52)(9)3-12-4790 --------------------------------------

« previous php.general (#50140) next »