Best Way To Format An HTML Email?

12,880

Solution 1

Find and use some kind of template library, if possible. This will make each email a template which will then be much easier to maintain than the hardcoded form.

Solution 2

Campaign monitor has some great, well-tested free templates:

http://www.campaignmonitor.com/templates/

Make sure whatever you use will display well in all clients.

A great guide:

http://www.campaignmonitor.com/blog/archives/2008/05/2008_email_design_guidelines.html

Solution 3

In addition to using some sort of template, as tedious as it is, inline styles are the most cross-client compatible way of styling HTML emails. Not every email client will fetch an external stylesheet and many don't do so well with an embedded style section.

That being the case, I would choose a fairly simple set of style rules for the email in order to ensure that it looks the same in different email clients and try not to rely too heavily on images as many client will require that extra click to show content.

Share:
12,880

Related videos on Youtube

Andrew Burgess
Author by

Andrew Burgess

I make websites do things.

Updated on April 16, 2022

Comments

  • Andrew Burgess
    Andrew Burgess about 2 years

    I am implementing a comment control that allows a person to select comments and have them sent to specified departments. The email needs to be formatted in a specific way, and I was wondering what the best way to do this would be.

    Should I just hard code all of the style information into one massive method, or should I try and create a separate file and read it in, and then replace certain tags with the relevant information?