Java based mailer not displaying properly in gmail
I have made a java mailer which is not displayin开发者_运维知识库g properly in gmail, but it is showing up properly in hotmail. In gmail, the CSS is not getting read properly, which disturbs the entire layout.
Follow a couple of rules:
- If possible, just design everything in a table. Keep
fixed
layout. - Don't use CSS file reference. Just do styling in the elements.
- Try avoiding images or at least keep as minimal as company's logo only.
- Keep limited number of links in E-mails. This point is to avoid your automated mails to go in junk folder.
- Avoid complex CSS rules.
Updated
By the way, you must set content type "text/html"
. You may look couple of good already done examples:
- Real's How to: http://www.rgagnon.com/javadetails/java-0504.html
- Another detailed and good worked out example: http://www.vipan.com/htdocs/javamail.html
Hope this helps.
精彩评论