HTML formatted text in an email in Java

前端 未结 4 483
花落未央
花落未央 2021-01-15 22:12
     try{
        String msg=\"Happy BirthDay Dear, \"+name.toUpperCase()+\"  !!! Have a Great Day. \\n \\n Thank You \\n Seva Development \";
            


        
4条回答
  •  终归单人心
    2021-01-15 22:36

    Since you are using MimeMessageHelper .Try below.

     MimeMessageHelper helper = new MimeMessageHelper(message,true);
     helper.setText(msg, true);
    

    Use MimeMessageHelper.setText(emailContent,true) method. The boolean true flag indicates html content.

提交回复
热议问题