SMTPSendFailedException: 554 DT:SPM 163问题解决

今天测试springboot自带邮件的插件,用刚生成的163校验码,配置了一下环境,具体代码实现如下
代码实现

  @Autowired
    private JavaMailSenderImpl javaMailSender;
    
    @Override
    public void sendMail(String title,String content){
        SimpleMailMessage message = new SimpleMailMessage();
        message.setSubject(title);
        message.setText(content);
        message.setFrom("[email protected]");
        message.setTo("[email protected]");
        javaMailSender.send(message);
    }

properties文件里面的配置如下

#邮件配置
spring.mail.username=***@163.com
# 这里使用授权码
spring.mail.password=*******
spring.mail.host=smtp.163.com
spring.mail.protocol=smtp

spring.mail.properties.mail.smtp.ssl.enable=true
    @Test
    public void hello(){
       helloController.sendMail("测试","邮件测试。。。");
    }

然后跑测试类的时候报错了554,如下图

com.sun.mail.smtp.SMTPSendFailedException: 554 DT:SPM 163 smtp8,DMCowAAHykA10wBcJuyiCg--.59524S2 1543557942,please see http://mail.163.com/help/help_spam_16.htm?ip=58.32.8.46&hostid=smtp8&time=1543557942

	at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2358)
	at com.sun.mail.smtp.SMTPTransport.finishData(SMTPTransport.java:2110)
	at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1316)
	at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:462)
	at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:321)
	at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:310)
	at com.hm.service.impl.HelloServiceImpl.sendMail(HelloServiceImpl.java:42)
	at com.hm.controller.HelloController.sendMail(HelloController.java:84)
	at com.hm.controller.HelloController$$FastClassBySpringCGLIB$$927db678.invoke()
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)

然后根据提示查看了http://mail.163.com/help/help_spam_16.htm?ip=58.32.8.46&hostid=smtp8&time=1543557942的信息,发现554

•554 DT:SPM 发送的邮件内容包含了未被许可的信息,或被系统识别为垃圾邮件。请检查是否有用户发送病毒或者垃圾邮件;

然后我看了下自己的备注发现并没有包含什么敏感信息,接着换一个账号这个账号之前注册过,不是当天的申请的授权码,

所以这个问题等到第二天再试下,应该就可以了

你可能感兴趣的:(springboot)