Jump to content

mail() sending incomplete message


ggensale

Recommended Posts

Alright...I have a code that dynamically generates an html newsletter that I e-mail out periodically.  Now once the html is created I use mail() to send it out, however the html is incomplete.

 

CODE:

$myHTML = BuildHTML();

mail("[email protected]","Newsletter","$myHTML","FROM:[email protected]\nContent-Type: text/html; charset=iso-8859-1");

 

Now if I echo $myHTML it works fine...

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/174643-mail-sending-incomplete-message/
Share on other sites

By incomplete I mean not all the HTML code generated by BuildHTML(); is being sent, but when I echo the code that was generated all of it appears...

 

I can only assume that the mail() function has some type of limit but I can't find that anywhere.

I'm not sure what might have been the problem but it is fixed now...I decieded to parse through the entire html that was being created looking for invalid HTML and maybe some escape character that I might have missed...I began by adding "\n" to format the html a little better (for instance my variable $myHTML was just one large string with no newlines).

 

Once I did that I viewed the HTML code in my browser, it look good (even though it always worked in the browser) and started looking over the code.  Since it looked good I proceeded to send it and to my surprise it worked.

 

I'm wondering if it was because my variable, $myHTML, didn't have any newlines in it...Anyways, I thank the ones that offered some assistance and I hope I can file this away as working now.

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.