springboot项目,使用javamail解析邮件.
后端调用bodyPart.getContent()获取到的是text/html类型的,怎么渲染到前端?
bodyPart.getContent()获取到的数据如下:
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<div>123</div>
springboot项目,使用javamail解析邮件.
后端调用bodyPart.getContent()获取到的是text/html类型的,怎么渲染到前端?
bodyPart.getContent()获取到的数据如下:
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<div>123</div>
// 创建一个包含HTML内容的MimeBodyPart
BodyPart html = new MimeBodyPart();
// 设置HTML内容
html.setContent(mailInfo.getContent(), "text/html; charset=utf-8");
mainPart.addBodyPart(html);