Springboot错误通过Gmail发送电子邮件

时间:2018-12-20 23:40:18

标签: spring-boot email gmail

我已经实现了一个使用springboot发送电子邮件的模块。

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-mail</artifactId>
    </dependency>

这是我的配置:

mail:
  default-encoding: UTF-8
  host: smtp.gmail.com
  username: ****@gmail.com
  password: ****
  port: 587
  properties:
    mail:
      smtp:
        auth: true
        starttls:
          enable: true
  protocol: smtp
  test-connection: false

如果我从本地主机运行代码,则可以正常工作。但是,当我在云服务器上部署springboot jar时,出现此错误:

  

“用户注册错误!错误:身份验证失败;嵌套异常为javax.mail.AuthenticationFailedException:534-5.7.14请通过\ n534-5.7.14登录您的Web浏览器,然后重试。\ n534-5.7 .14在\ n534 5.7.14了解更多信息https://support.google.com/mail/answer/78754 x10sm6540210edb.58-gsmtp \ n“

这是证书问题吗?有人可以帮助我吗?

0 个答案:

没有答案