Bug #15957 Updated: HTML-code and header in mail message
| From: | richard at nmw dot nl | Date: | Fri, 08 Mar 2002 13:15:24 +0000 |
| Subject: | Bug #15957 Updated: HTML-code and header in mail message | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-2027@lists.php.net to get a copy of this message | ||
ID: 15957
Updated by: richard@nmw.nl
Reported By: richard@nmw.nl
Status: Open
Bug Type: *Mail Related
Operating System: RedHat Linux
PHP Version: 4.1.2
New Comment:
Unfortunately I've got no gdb backtrace.
Previous Comments:
------------------------------------------------------------------------
[2002-03-08 08:13:28] richard@nmw.nl
If I use the mail function of PHP 4.1.2 and I use the following code:
==========================================================
<?
/* recipients */
$to = "Richard <richard@nmw.nl>"; //note the comma
/* subject */
$subject = "HTML Testmail ";
/* message */
$message = '
<html>
<head>
<title>HTML Testmail</title>
</head>
<body>
<p>HTML Testmail</p>
<table>
<tr>
<th>ID</th><th>Voornaam</th><th>Achternaam</th><th>Year</th>
</tr>
<tr>
<td>1</td><td>Richard</td><td>Sterken</td><td>1970</td>
<td>2</td><td>Danny</td><td>Dam
Wichers</td><td>1973</td>
</tr>
</table>
</body>
</html>
';
/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
/* additional headers */
$headers .= "From: Mailer Daemon <mailerdaemon@nmw.nl>\r\n";
/* and now mail it */
echo mail($to, $subject, $message, $headers);
?>
==========================================================
I recieve a mail like this:
==========================================================
Content-type: text/html; charset=iso-8859-1
From: Mailer Daemon <mailerdaemon@nmw.nl>
<html>
<head>
<title>HTML Testmail</title>
</head>
<body>
<p>HTML Testmail</p>
<table>
<tr>
<th>ID</th><th>Voornaam</th><th>Achternaam</th><th>Year</th>
</tr>
<tr>
<td>1</td><td>Richard</td><td>Sterken</td><td>1970</td>
<td>2</td><td>Danny</td><td>Dam
Wichers</td><td>1973</td>
</tr>
</table>
</body>
</html>
==========================================================
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=15957&edit=1