Layout in html email with JavaMail API

2019-09-16 10:34发布

问题:

I'm having a hard time trying to compose a great looking (layout wise) html email with JavaMail API.

I know how to add a picture inside the email body, and then add text above and below, but that's kinda it. I'm really hoping to create a little more complex layout with some separators, image borders, larger text titles and so on.

Would I need to know html in order to create this, or does anyone know of a good guide or tutorial on how to work with html JavaMail?

Hope this question isn't to abstract for stackoverflow, thanks.

回答1:

This is not a JavaMail problem.

Compose your html however you want. Then use the MimeBodyPart setText(content, charset, "html") method.