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).