Jump to content

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("myemail@myemail.com","Newsletter","$myHTML","FROM:myemail@myemail.com\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.

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.