我正在使用以下代码,它在浏览器中运行良好,但在 Outlook 中显示的格式不正确:
MimeMultipart mimeMultipart = new MimeMultipart();
MimeBodyPart bodyPart = new MimeBodyPart();
bodyPart.setText("<html><body><font size='3px' face='Times New Roman'>"
+ removeMultipleSpaces(msgbody) + "</font></body></html>");
mimeMultipart.addBodyPart(bodyPart);
bodyPart.setDescription("Text");
bodyPart.setHeader("Content-Type", "text/html; charset=utf-8" );