From: [EMAIL PROTECTED] Operating system: RedHat Linux PHP version: 4.1.2 PHP Bug Type: *Mail Related Bug description: HTML-code and header in mail message
If I use the mail function of PHP 4.1.2 and I use the following code: ========================================================== <? /* recipients */ $to = "Richard <[EMAIL PROTECTED]>"; //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 <[EMAIL PROTECTED]>\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 <[EMAIL PROTECTED]> <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 bug report at http://bugs.php.net/?id=15957&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=15957&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=15957&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=15957&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=15957&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=15957&r=support Expected behavior: http://bugs.php.net/fix.php?id=15957&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=15957&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=15957&r=submittedtwice