邮件发送
1、配置文件
文件位置:dodo_framework_config.properties
dodo.mailsender.smtpHost=smtp.exmail.qq.com
dodo.mailsender.smtpPort=25
dodo.mailsender.smtpUsername=admin@bydodo.com
dodo.mailsender.smtpPassword=123456
dodo.mailsender.smtpCompanyName=Dodo Framework
dodo.mailsender.smtpFromMail=admin@bydodo.com
2、使用
@Autowired
private MailService mailService;
3、MailService
public interface MailService {
void sendMail(String subject, String templateFilePath, Map<String, Object> data, String toMail)
throws TemplateException, MessagingException, IOException;
void sendMail(String subject, String msgContent, String toMail) throws MessagingException,
UnsupportedEncodingException;
void sendMail(String subject, String templateFilePath, Map<String, Object> data, String[] toMail)
throws IOException, TemplateException, MessagingException;
void sendMail(String subject, String msgContent, String[] toMail) throws MessagingException,
UnsupportedEncodingException;
}