Jump to content


This topic is now archived and is closed to further replies.


sending html email with php

Recommended Posts

This is so wierd. I am getting very frustrated. This is the worst kind of coding bug you can get!!! Why? cos its random and I cant track where the problem is coming from.

Ok, let me explain:

I have an html file that holds the html layout for the email. (email_template.html)

From php, I use:

[code]$htmlbody = file_get_contents("email_template.html");[/code]

within this html file, I have a variable: $$content$$

I set a variable ($content) and give it some more html, but within php. Then I say in php:

[code]htmlbody = str_replace('$$content$$', $content, $htmlbody);[/code]

Finally I use phpMailer to send the email using $htmlbody

This ALWAYS worked before! But now I get some really wierd result within the html from any email client. And I always randomly get this within the html that messes it up -> & # 13;&# 10;

I know thats ascii line feed and something else...But why dont I just get clean html and untouched when its been sent? Any help appreciated

Share this post

Link to post
Share on other sites
The $ symbol is used quite a bit by PHP -- Just for grins, I'd change it with a # symbol and see what happens.


Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.