开发者

Rules when creating HTML E-Mails?

Is there anything I need to be aware of when creating a HTML 开发者_JS百科e-mail? Is it as simple as creating a valid HTML page then sending it via PHP? Or do I need to use tables to ensure it display's correctly.

Any advice to get this right first time would be much appreciated.


Creating an HTML email that displays the way you want to in email clients, can be very difficult, if not impossible. Unfortunately, email clients do not use the latest and greatest web browsers when displaying emails, and they can also restrict what should be allowed (and with good reasons).

No matter how much you might love CSS-based layouts, table-based layout is still the way to go for HTML emails. You can still use CSS for other things, of course, but in some cases it will need to be inline. The best looking HTML emails I've seen, are largely made up of tables and big images - simply because unlike on normal web pages it is nigh on impossible to create the equivalent using good web development practices. HTML email is a world of its own.

You should also test the emails in as many email clients as you can - and while it can be cumbersome to install all the different clients, you can also use services such as Litmus, MailChimp and CampaignMonitor (see also this question). Personally I have had good experiences with Litmus.

Good luck, creating HTML emails can be quite messy!


Tables are definitely the best option for HTML emails, since most other methods tend to display differently on different machines.

Things to watch out for:

  • Images are often blocked by email programmes - try to use background colours where possible
  • Don't link to an external stylesheet - put the styles in <head>. This will prevent your server being hit when the emails are opened.

There's also a good blog post from Mailchimp about using CSS in HTML emails.


Tables is bad...but the correct way to go in emails... Also send only the part you would normally put in the body and only use inline css. Another important thing is that background images most of the time dont work.

This is a very good guide that can help you out.

my advice: test in a lot of browsers,mailclients and email programs


You should check out Email on Acid, they not only show you what your email will look like in each client they also analyze your HTML. They highlight the HTML in you code that is not supported in the clients. This tool has saved me hours trying to figure out why an email doesn't render correctly.

One other thing that is very helpful is they provide Tips & Tricks for each client. Anyway you might want to check it out, very helpful.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜