【发布时间】:2011-07-14 11:23:58
【问题描述】:
我已经使用这个成功发送了简单的电子邮件:
SimpleMailMessage mailMessage = new SimpleMailMessage();
mailMessage.setTo("someone@abc.com");
mailMessage.setSubject("This is the test message for testing gmail smtp server using spring mail");
mailMessage.setFrom("abc@gmail.com");
mailMessage.setText("This is the test message for testing gmail smtp server using spring mail. \n" +
"Thanks \n Regards \n Saurabh ");
mailSender.send(mailMessage);
我需要更改什么设置才能发送 html 电子邮件
【问题讨论】:
-
这里还有一篇关于如何使用 spring 发送电子邮件的帖子。它对电子邮件的 HTML 内容使用速度模板,在示例中它使用 Gmail 发送电子邮件。但我认为您可以配置任何邮件服务器供您使用。它也有附件示例。 Send Email with Spring Using Velocity Template.
标签: java spring-mvc