Re: HTML Email

From: Date: Mon, 19 Jun 2000 23:48:01 +0000
Subject: Re: HTML Email
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-2254@lists.php.net to get a copy of this message
At 02:53 PM 6/19/00, you wrote:
$mailHeaders = "From: $email"; $mailHeaders .= "MIME-Version: 1.0"; $mailHeaders .= "Content-Type: text/html"; $mailHeaders .= "X-Header-Type: HTML";
As everyone's pointed out, you need newlines. Here's a PHP4-specific version which is a little more obvious: $mailHeaders = <<<ENDHEADERS From: $email Content-Type: text/html MIME-Version: 1.0 X-Header-Type: HTML ENDHEADERS; The here doc format makes it a bit more clear what a specific block of code does and eliminates the need to do all of that string escaping and newlines. This probably isn't that big a deal for what you're doing but if you want to send a muli-part MIME message quickly, it's quite handy.

« previous php.general (#2254) next »