我使用MimeMessageHelper实现了春季电子邮件
@Bean
public MimeMessage getMimeMessage(){
MimeMessage message = emailSender.createMimeMessage();
return message;
}
@Bean
public MimeMessageHelper mimeMessageHelper(){
MimeMessageHelper helper = new MimeMessageHelper(message, true);
helper.setTo(to);
helper.setSubject(subject);
helper.setText(text);
}
所有bean都是自动装配的。当我第一次调用JavaMailSender.send(MimeMessage)时,将发送电子邮件。但是当我第二次调用send方法时,不会发送电子邮件。请提供建议