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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.