VSoft Technologies Blogs


VSoft Technologies Blogs - posts about our products and software development.

FinalBuilder has been able to send HTML emails for some time, but it's not as flexible as some users required.  We've recently added the ability to specify a separate “Plain Body” to the “HTML Body”. 

Unfortunately we've encounted a few problems - mainly the way that different email clients handle the HTML and Plain Text parts, especially in conjunction with an attachment.  To add to that, some email clients don't even display, or allow display of the text part of an HTML email (eg. PocoMail).

Anyway, some R&D was required to figure out how all the different parts fit together to form a email message which can be correctly read by the majortity of email clients.  Here what I ended up with:

Plain Body only         -> ContentType = ''
Plain Body + Attachment -> ContentType = 'multipart/mixed'
HTML Body only          -> ContentType = ''
HTML Body + Attachment  -> ContentType = 'multipart/mixed'
Plain Body + HTML Body  -> ContentType = 'multipart/alternative'
Plain, HTML, Attachment -> Part1 = 'multipart/mixed' (consists of Part2 and Attachments)
                           Part2 = 'multipart/alternative' (consists of Plain and HTML parts)

Hmmm... doesn't look too complicated when it's layed out nicely like that, does it?  The problems was finding a nice readable guide on how to get the correct ContentTypes.  Unfortunately the Indy documentation didn't help much at all, and the example email client in Indy didn't deal with HTML email.  This is the best article I found which did help quite a lot: http://bdn.borland.com/article/0,1410,32075,00.html

So, at the end of all this, the HTML email support in FinalBuilder is now more compatible and better featured than before.

Showing 0 Comment

Comments are closed.