Jump to content


Photo

sending html email with php


  • Please log in to reply
1 reply to this topic

#1 hga77

hga77
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 20 April 2006 - 10:04 PM

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:

$htmlbody = file_get_contents("email_template.html");

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:

htmlbody = str_replace('$$content$$', $content, $htmlbody);

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

#2 michaellunsford

michaellunsford
  • Members
  • PipPipPip
  • Advanced Member
  • 1,023 posts
  • LocationLouisiana, USA

Posted 20 April 2006 - 10:26 PM

The $ symbol is used quite a bit by PHP -- Just for grins, I'd change it with a # symbol and see what happens.

##content##




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users