0
我必须在Outlook中打开一个html代码,而不是发送电子邮件。我需要先在Outlook中打开内容,然后提供一个选项供用户编辑,如果他愿意的话。在outlook中打开HTML代码在java中
我希望用户手动发送电子邮件。我只想在Outlook邮件中显示信息,然后用户可以手动发送。
样本HTML内容:
<HTML>
<body>
<b>Hello test</b>
</body>
</HTML>
上面的HTML我需要在Outlook邮件打开。
代码:
System.out.println("Gettjg in");
String recipientName = null;
System.out.println("receiver"+receiver.toString());
// Prepare the evaluation context
final Context ctx = new Context(locale);
ctx.setVariable("name", recipientName);
ctx.setVariable("remedyGroup", recipientName);
ctx.setVariable("regards", recipientName);
ctx.setVariable("assigneeName", recipientName);
ctx.setVariable("assigneeGroup", recipientName);
ctx.setVariable("subscriptionDate", new Date());
ctx.setVariable("hobbies", Arrays.asList("Cinema", "Sports", "Music"));
// Prepare message using a Spring helper
final MimeMessage mimeMessage = this.mailSender.createMimeMessage();
final MimeMessageHelper message = new MimeMessageHelper(mimeMessage, "UTF-8");
message.setSubject(receiver.getTicketSummary());
message.setFrom("[email protected]");
message.setTo(receiver.getReceiverEmail());
// Create the HTML body using Thymeleaf
final String htmlContent = this.templateEngine.process("email-simple.html", ctx);
message.setText(htmlContent, true /* isHtml */);
try {
Desktop.getDesktop().mail(new URI("mailto:[email protected]?subject="+message+"&cc="+"fsf"+"&body="+htmlContent));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
我不知道我怎样才能打开后市一个HTML内容。任何人都可以知道如何在Outlook中打开HTML内容而不是发送它。
请详细说明'打开html内容。不确定你的意思。 –
需要先在Outlook中打开内容,然后提供一个选项让用户编辑它,如果他愿意的话 – bharathi
我无法在outlook中打开html信息 – bharathi