在电子邮件地址上收到此错误我正在尝试发送电子邮件给!
不知道为什么我需要验证我发送的不属于我的电子邮件?
DEBUG SMTP:发送时出现MessagingException:THROW:com.sun.mail.smtp.SMTPSendFailedException:554拒绝邮件:未验证电子邮件地址 . 以下身份未通过检查区域EU-WEST-1:danielhaughton@outlook.com
@Configuration
@PropertySource("app.properties")
@EnableTransactionManagement
public class AppConfig {
@Autowired
private Environment env;
@Bean
public JavaMailSender getJavaMailSender() {
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
mailSender.setHost("email-smtp.eu-west-1.amazonaws.com");
mailSender.setPort(25);
mailSender.setUsername("removedcreds");
mailSender.setPassword("removed creds");
Properties props = mailSender.getJavaMailProperties();
props.put("mail.transport.protocol", "smtp");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.smtp.starttls.required", "true");
props.put("mail.debug", "true");
return mailSender;
}
EmailService @Component公共类EmailServiceImpl {
@Autowired
public JavaMailSender emailSender;
public void sendSimpleMessage(String toAddress, String subject, String text)
{
SimpleMailMessage message = new SimpleMailMessage();
message.setTo(toAddress);
message.setFrom("noreply@mydomain.com");
message.setSubject(subject);
message.setText(text);
emailSender.send(message);
}
}
我的emailserviceimpl是自动发送到我发送电子邮件的Web控制器
1 回答
默认情况下,您的AWS账户的SES功能是沙盒,并且在SES沙箱中具有某些限制 .
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/request-production-access.html
请参阅此博客文章,其中概述了退出沙箱的步骤 . https://aws.amazon.com/blogs/ses/ses-limit-increase-form-consolidation/