search

Home  >  Q&A  >  body text

java - How to send html content via email

How to generate content in this html format? ? ?

I saw a lot of string splicing on the Internet, but this doesn’t work, it’s too troublesome.

java language

为情所困为情所困2784 days ago959

reply all(3)I'll reply

  • 黄舟

    黄舟2017-06-12 09:28:09

    Java Mail, content writes your html code
    message.setContent(content, "text/html;charset=UTF-8")

    reply
    0
  • 为情所困

    为情所困2017-06-12 09:28:09

    Here’s a way: If you don’t want to concatenate strings, you can use a template engine. For example: freemarker

    reply
    0
  • ringa_lee

    ringa_lee2017-06-12 09:28:09

    Use java mail framework, this is java development, java sends emails, a must-have medicine for home and travel

    reply
    0
  • Cancelreply