Java mail encoding non english characters

后端 未结 3 369
日久生厌
日久生厌 2020-12-16 22:27

Using the code below i can send an email written in non-english and although the subject appears correctly the body appears as gibberish.
Any ideas?
Thank you

<
3条回答
  •  情歌与酒
    2020-12-16 22:44

    Try:

    msg.setContent(message, "text/plain; charset=UTF-8");
    

    Edit Changed to text/plain.

提交回复
热议问题