How to give inline style css in java mail?or How to include CSS in java mail?
How to give inline style css in java mai开发者_运维技巧l? or How to include CSS in java mail?
The first thing you need to do is indicate that you will be sending html and not plain text. You can do this by setting the content type:
message.setContent(text, "text/html; charset=utf-8");
Once you do that you can use CSS in your email body content. Be careful as not all the features of CSS are available for your use in an email. See http://www.sitepoint.com/how-to-code-html-email-newsletters/ for more
精彩评论