ggensale Posted September 17, 2009 Share Posted September 17, 2009 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? Quote Link to comment Share on other sites More sharing options...
MadTechie Posted September 17, 2009 Share Posted September 17, 2009 Really need more info. define "incomplete" an example would really help us help you! Quote Link to comment Share on other sites More sharing options...
ggensale Posted September 18, 2009 Author Share Posted September 18, 2009 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. Quote Link to comment Share on other sites More sharing options...
MadTechie Posted September 18, 2009 Share Posted September 18, 2009 Never has limit problems myself, Need more info.. Quote Link to comment Share on other sites More sharing options...
jcombs_31 Posted September 18, 2009 Share Posted September 18, 2009 My best guess would be that you are probably not escaping something correctly in your buildHTML function, but sherlock combs doesn't know that without seeing code Quote Link to comment Share on other sites More sharing options...
ggensale Posted September 19, 2009 Author Share Posted September 19, 2009 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. Quote Link to comment Share on other sites More sharing options...
MadTechie Posted September 19, 2009 Share Posted September 19, 2009 Great So word wrapping issue ? (Can you click solved bottom left) Quote Link to comment Share on other sites More sharing options...
TheFilmGod Posted September 20, 2009 Share Posted September 20, 2009 Don't forget that /n doesn't apply to all computer system. To be safe you need to use /r/n I believe. Quote Link to comment Share on other sites More sharing options...
MadTechie Posted September 20, 2009 Share Posted September 20, 2009 Well /n is unix /r/n is windows and /r is mac, but when his dealing with HTML so the use of /n is fine! as a note if you wanted to be you should use PHP_EOL instead of hard coding /n Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.