email - php mail function with html not shown correct in exchange -
i got strange problem php mail , exchange. when use simple php html mailscript, see below (can found on internet) see mail kind of plain text (see below) mail in microsoft exchange. when send mail other account outlook see mail html-mail should be.
doest got clue?
mailscript:
<?php // multiple recipients $to = 'aidan@example.com' . ', '; // note comma $to .= 'wez@example.com'; // subject $subject = 'birthday reminders august'; // message $message = ' <html> <head> <title>birthday reminders august</title> </head> <body> <p>here birthdays upcoming in august!</p> <table> <tr> <th>person</th><th>day</th><th>month</th><th>year</th> </tr> <tr> <td>joe</td><td>3rd</td><td>august</td><td>1970</td> </tr> <tr> <td>sally</td><td>17th</td><td>august</td><td>1973</td> </tr> </table> </body> </html> '; // send html mail, content-type header must set $headers = 'mime-version: 1.0' . "\r\n"; $headers .= 'content-type: text/html; charset=iso-8859-1' . "\r\n"; // additional headers $headers .= 'to: mary <mary@example.com>, kelly <kelly@example.com>' . "\r\n"; $headers .= 'from: birthday reminder <birthday@example.com>' . "\r\n"; $headers .= 'cc: birthdayarchive@example.com' . "\r\n"; $headers .= 'bcc: birthdaycheck@example.com' . "\r\n"; // mail mail($to, $subject, $message, $headers); ?>
view in exchange:
content-type: text/html; charset=iso-8859-1 from: birthday reminder <birthday@example.com> subject:birthday reminders august return-path: root@server2.nedstars.nl x-originalarrivaltime: 06 oct 2010 13:39:59.0117 (utc) filetime=[f839fbd0:01cb655b] <html> <head> <title>birthday reminders august</title> </head> <body> <p>here birthdays upcoming in august!</p> <table> <tr> <th>person</th><th>day</th><th>month</th><th>year</th> </tr> <tr> <td>joe</td><td>3rd</td><td>august</td><td>1970</td> </tr> <tr> <td>sally</td><td>17th</td><td>august</td><td>1973</td> </tr> </table> </body> </html>
try replace "\r\n"
"\n"
in headers
Comments
Post a Comment