Welcome Guest, Not a member yet? Register   Sign In
[CI 1.7 rev 1572+] Email Class - html email problems
#1

[eluser]a&w[/eluser]
I went through the various threads for people having problems sending html emails. Mostly a lot of issues with carriage returns or having problems finding the config file, etc. Originally I was trying to play with all those things (crlf, etc.) to no avail, so I decided to dig through the code.

I should probably state the following platform conditions just to be complete:
Apache on Windows Box, Outlook 2007 MUA, and using mail protocol.

What I found in the Email class was really confusing how it would work for anyone. Basically it appears that when sending html emails the Email class would put part of the message (the alternate message) in the header, and the other part (the html message) in the body. What I had read elsewhere is to put both the alternate and html messages in the body, and let the MUA pick which one of those "body" messages to use.

Using the original version of the Email class I had all sorts of weird things happening, carriage return problems in the message and subject line, html tags coming through, part of both message types would show up in the body, etc. etc.

I noticed some inconsistency in the library's handling and took a stab at fixing it. I just attached my version since I figured that would make it easiest for someone to do a diff on it. I created two little helper methods just so the repetitive coding could be eliminated and make it easier to maintain.

Anyway, with the attached changes, all of the problems I mentioned having were solved. I have a whole bunch test emails showing the source code of the emails and how screwed up it was, but I'll refrain from posting unless someone requests it. I think the attached code illustrates the problem sufficiently by itself.

I'll post a peek of the portion of the code I altered in the next post. (Post #3 has corrected version of code).


Messages In This Thread
[CI 1.7 rev 1572+] Email Class - html email problems - by El Forum - 11-19-2008, 11:11 AM
[CI 1.7 rev 1572+] Email Class - html email problems - by El Forum - 11-19-2008, 11:11 AM
[CI 1.7 rev 1572+] Email Class - html email problems - by El Forum - 11-19-2008, 11:20 AM
[CI 1.7 rev 1572+] Email Class - html email problems - by El Forum - 11-19-2008, 11:31 AM
[CI 1.7 rev 1572+] Email Class - html email problems - by El Forum - 12-15-2008, 11:31 AM
[CI 1.7 rev 1572+] Email Class - html email problems - by El Forum - 12-15-2008, 11:55 AM
[CI 1.7 rev 1572+] Email Class - html email problems - by El Forum - 12-16-2008, 05:26 PM
[CI 1.7 rev 1572+] Email Class - html email problems - by El Forum - 06-20-2009, 02:38 PM
[CI 1.7 rev 1572+] Email Class - html email problems - by El Forum - 07-26-2009, 04:32 AM
[CI 1.7 rev 1572+] Email Class - html email problems - by El Forum - 09-04-2009, 12:10 AM
[CI 1.7 rev 1572+] Email Class - html email problems - by El Forum - 06-22-2010, 04:58 AM
[CI 1.7 rev 1572+] Email Class - html email problems - by El Forum - 09-29-2010, 08:24 AM
[CI 1.7 rev 1572+] Email Class - html email problems - by El Forum - 09-29-2010, 08:36 AM
[CI 1.7 rev 1572+] Email Class - html email problems - by El Forum - 10-02-2012, 02:33 PM



Theme © iAndrew 2016 - Forum software by © MyBB