163 邮箱发 qq 邮箱 总是报 554 DT:SPM 163 smtp11
554 DT:SPM 发送的邮件内容包含了未被许可的信息,或被系统识别为垃圾邮件。请检查是否有用户发送病毒或者垃圾邮件;
发送了挺多次了 就只测试成功一次 ,然后写工具类后又失败了,执行原测试代码也一样,自己发给自己没问题
发送的内容都避免 test javvMail 等字眼了 配置:
spring.mail.host=smtp.163.com [email protected] spring.mail.password=xxxxxxx spring.mail.protocol: smtp spring.mail.properties.mail.smtp.auth: true spring.mail.properties.mail.smtp.port: 994 spring.mail.properties.mail.smtp.starttls.enable: true spring.mail.properties.mail.smtp.starttls.required: true spring.mail.properties.mail.smtp.ssl.enable: true spring.mail.default-encoding: utf-8
public static void sendSimpleMail(String to, String subject, String contnet){ JavaMailSender mailSender = BeanTool.getBean(JavaMailSender.class); SimpleMailMessage message = new SimpleMailMessage(); message.setTo(to); message.setSubject(subject); message.setText(contnet); message.setFrom(ConfigEmailValue.EMAIL_FROM); mailSender.send(message); }