Here is an example that I use myself for sending HTML code via email.

<?
function qp_encode($str) {
 $chars = preg_split('//', $str, -1, PREG_SPLIT_NO_EMPTY);
   foreach ($chars as $char) {
         if (ord($char) > 127 || ord($char) == "61")
            $result .= sprintf("=%X", ord($char));
         else
            $result .= $char;
   }
 return $result;
}
$content = "<HTML></HTML>";
$content = qp_encode($content);

mail("email","subject",$content,"From: someone@someone\nMime-Version: 
1.0\nContent-Type: text/html; charset=\"iso-8859-1\"\nContent-Transfer-Encoding: 
quoted-printable\n");
?>

This encodes the content so email readers like Microsoft Outlook can read the mail.

Best regards,

Jome

----- Original Message ----- 
From: "Adrian D'Costa" <[EMAIL PROTECTED]>
To: "php general list" <[EMAIL PROTECTED]>
Sent: Monday, July 23, 2001 12:08 PM
Subject: [PHP] mail with html


> Hi,
> 
> I know this subject had been discussed here before.  Tried searching in
> list.php.net, I get a message search not setup (or something).
> 
> I want to send html mails thru php using mail().  Could someone tell me
> where I can study some scripts or tutorials.
> 
> TIA
> 
> Adrian
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to