html mail not displaying correctly

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
shivam0101
Forum Contributor
Posts: 197
Joined: Sat Jun 09, 2007 12:09 am

html mail not displaying correctly

Post by shivam0101 »

I am storing templates in database table, when a mail has to be sent that template will be fetched and replaced and sent. The template are created by using fckeditor. When i send mail, i am getting the mails in HTML like,



<table>
<tr><td>MYname</td></tr>

</table>
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Content-type not/improperly set?
shivam0101
Forum Contributor
Posts: 197
Joined: Sat Jun 09, 2007 12:09 am

Post by shivam0101 »

Code: Select all

$headers='MIME-Version: 1.0\r\n';
$headers.='Content-type: text/html; charset=iso-8859-1\r\n';
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Yep, improperly set, I believe.

In single quote strings \r and \n (among others) are not parsed as carriage-return/line-feed metacharacters, but literally as are.
shivam0101
Forum Contributor
Posts: 197
Joined: Sat Jun 09, 2007 12:09 am

Post by shivam0101 »

Thanks. It got solved after i put double quotes.
Post Reply