Hello!
Just registered here after troubleshooting a problem for over 8 hours and I can't figure it out and I'm about to go crazy trying.
My problem is that I'm trying to send a very basic HTML email message which contains really only tables and font codes. No pics or anything like that, just text and tables.
The HTML email is being generated via a php script which has "if" statements in it and all kinds of stuff but that's not the problem. The problem is RANDOM in that it will randomly drop HTML coding characters out of the middle of the the email message variable. What I'm doing is generating an order page for an ecommerce site and sending an email to both the customer and store owner. Both emails use the SAME variable for the message (body of the email) but are dropping different characters. Sometimes just one, sometimes several in different spots, and sometimes it works just fine. I'll then make another order and it will drop different characters which makes the table messed up or underlines something or messes up the font, etc.
Since I'm testing this and have multiple email address (through Road Runner so not hotmail or yahoo or anything like that) I have one setup as the store owner and another setup as the customer. So, just to make this even more confusing is that the emails are not only being sent from the same server but are coming to me via the same email client???
Just as an example...
When I view the sorce of an email that has the font messed up in a certain cell of a table, this is what I see...
<FNT FACE= "Tahoma" SIZE=-1>
The reason why it isn't working is obvious... it is dropping the "O" in FONT but how is that? This is in the MIDDLE of the variable so it's not like it is even not appending the variable correctly in my code.
Now, in the other email that was sent at exactly the same time it WILL have the "O" when I view the source but it might drop off a space between, for example a <table align = blah command and it will be instead <tablealign so then it doesn't see the table tag in that email and messes it all up too but in a different way.
The mail() functions are on top of each other in the php code too like this..
mail("$email", $subject, $email_body, $headers);
mail("$site_email", $subject, $email_body, $headers);
As you can see, it is sending the same message variable but somehow after/during this it is dropping random characters in the email itself by the time it arrives to me!
I've searched Google for answers, I've searched here, and can find nothing relating to this problem 🙁
I've tried putting nothing at the end of each line. I've tried putting \n at the end of each line. I've tried putting \r\n. All kinds of stuff and nothing seems to work any better than anything else?
Here are my headers...
$headers = "From: ".$site_business." <".$site_email.">\r\n";
$headers.= "Reply-To: ".$site_business." <".$site_email.">\r\n";
$headers.= "MIME-Version: 1.0\r\n";
$headers.= "Content-type: text/html; charset=iso-8859-1\r\n\r\n";
My machine is a Windows XP Pro machine and I'm using Outlook 2003.
The server machine is a Windows 2000 server running IIS.
Any help or advice anybody can give would be greatly appreciated! Thanks!!!