RE: [PHP-INST] Mail in HTML Format

From: Date: Fri, 05 Apr 2002 17:30:17 +0000
Subject: RE: [PHP-INST] Mail in HTML Format
Groups: php.install 
Request: Send a blank email to php-install+get-6567@lists.php.net to get a copy of this message
Hi Salvador, Here's an example of a big HTML mail with PHP (I took this from the reference manual). You don't have to include things like additional recipients, or the carbon-copy/blind-carbon-copy, if you don't need them. those are all for just sending the e-mail to more people, and you can leave out the code for them if you are only sending the e-mail to one person. <? // ====================================== // main recipient // ====================================== $to = "Jorge <jorge@mail.com>"; // ====================================== // additional recipients // ====================================== $to .= " , "; $to .= "Ernesto <ernesto@yahoo.com>"; $to .= " , "; $to .= "Juan Pablo <jpablo@ibm.com>"; // ====================================== // subject of email // ====================================== $subject = "Hola!"; // ====================================== // HTML email message // ====================================== $message = ' <html> <body> <b>Como estas?</b> </body> </html> '; // ====================================== // this makes it into a HTML message // ====================================== $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; // ====================================== // sender of the e-mail (your info) // ====================================== $headers .= "From: Salvador Gil <sgil@fertinal.com.mx>\r\n"; // ====================================== // carbon-copy and/or blind-carbon-copy // ====================================== $headers .= "Cc: maria@microsoft.com\r\n"; $headers .= "Bcc: abogado@espia.com\r\n"; // ====================================== // send the e-mail // ====================================== mail($to, $subject, $message, $headers); ?> -----Original Message----- From: Salvador Gil [mailto:sgil@fertinal.com.mx] Sent: Thursday, April 04, 2002 6:06 PM To: php-install@lists.php.net Subject: [PHP-INST] Mail in HTML Format Any body can help me? I trying to send a mail in HTML Format, but I get it in text format.

« previous php.install (#6567) next »