Jump to content

sending html email with php


hga77

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
Link to comment
https://forums.phpfreaks.com/topic/7998-sending-html-email-with-php/
Share on other sites

Archived

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

×
×
  • Create New...

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.