美文网首页
Springboot 使用网易邮箱开启SSL

Springboot 使用网易邮箱开启SSL

作者: 鹅鹅鹅_ | 来源:发表于2019-05-27 11:23 被阅读0次

本来本地测试使用网易邮箱都没有问题,邮件能正常发送

spring.mail.host=smtp.163.com
spring.mail.username=xxx@163.com
spring.mail.password=xxx
spring.mail.port=25
spring.mail.protocol=smtp
spring.mail.default-encoding=UTF-8

然鹅部署到腾讯云,报错了

Mail server connection failed; nested exception is com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.163.com, 25; timeout -1;

腾讯云也是一样的原因

原因

解决方法,可以使用ssl加密,465端口,相关配置如下

spring.mail.host=smtp.163.com
spring.mail.username=xxx@163.com
spring.mail.password=xxx
spring.mail.port=465
spring.mail.protocol=smtp
spring.mail.default-encoding=UTF-8
spring.mail.properties.mail.smtp.ssl.enable=true
spring.mail.properties.mail.imap.ssl.socketFactory.fallback=false
spring.mail.properties.mail.smtp.ssl.socketFactory.class=com.fintech.modules.base.util.mail.MailSSLSocketFactory
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true
spring.mail.properties.mail.smtp.starttls.required=true

相关文章

  • Springboot 使用网易邮箱开启SSL

    本来本地测试使用网易邮箱都没有问题,邮件能正常发送 然鹅部署到腾讯云,报错了 腾讯云也是一样的原因 解决方法,可以...

  • Jenkins邮件配置失败问题

    配置Jenkins邮件时,使用126邮箱 1、邮件通知部分,勾选“使用SSL协议”报错 2、126邮箱未开启第三方...

  • 【后端论坛项目案例】SpringMail + Thymeleaf

    1. 配置邮箱 这里以网易邮箱为例:首先注册一个网易邮箱开启 IMAP/SMTP 服务,获取一个授权码,作为发送邮...

  • ThinkPHP5.0之邮箱发送与回复

    ThinkPHP框架5.0 环境phpStudy 网易邮箱为例 xxx@yeah.net 1.开启邮箱SMTP功...

  • nodejs发送邮件

    qq邮箱,先去qq邮箱设置中获取到授权码 自己搭建的邮箱服务, 要数据用户名和密码, 指定服务ip和端口,开启ssl

  • QQ邮箱产品体验报告

    为什么是QQ邮箱呢?在网易实习的时候我也是使用网易邮箱大师的,并且持续了很长的时间。但是很遗憾的是,网易邮箱大师在...

  • 网易邮箱收取第三方邮件的方法

    网易邮箱开启POP3/SMTP功能后,可以通过授权码的方式在第三方邮件中收取。QQ邮箱也类似。 网易邮箱收取第三方...

  • 常用邮箱的IMAP、SMTP配置

    QQ邮箱 腾讯企业邮箱 Gmail邮箱 Outlook邮箱 iCloud邮箱 网易126邮箱 网易163邮箱

  • 12 综合实战

    网易邮箱注册: 网易邮箱登录 网易邮箱发送邮件 LoginDemo: 欢迎关注个人公众号:

  • Mac 下配置接收163邮箱

    mac 下配置邮箱第三方登录 以网易163 邮箱为例 1 登录163邮箱点击设置 ,开启pop3 服务 pop...

网友评论

      本文标题:Springboot 使用网易邮箱开启SSL

      本文链接:https://www.haomeiwen.com/subject/rbbctctx.html