Re: mail with html
| From: | Jome | Date: | Mon, 23 Jul 2001 13:22:57 +0000 |
| Subject: | Re: mail with html | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-59185@lists.php.net to get a copy of this message | ||
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" <adrian@pcsadvt.com>
To: "php general list" <php-general@lists.php.net>
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: 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
>
>