使用QQ发送邮件时遇到的坑比问题
java.net.SocketTimeoutException: Read timed out
java.net.SocketTimeoutException: Read timed out. Failed messages: javax.mail.MessagingException: Exception reading response;
![在这里插入图片描述](https://img-blog.csdnimg.cn/2020012120002621.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM1OTUzOTY2,size_16,color_FFFFFF,t_70)
这个问题困扰了我一下午,如果你和我一样也是时而可以发送成功,时而失败。那么赶紧换掉qq邮箱
换成网易时犯得一个愚蠢错误,不过还是记录一下
com.sun.mail.smtp.SMTPSenderFailedException: 553 Mail from must equal authorized user
如果你已经仔细检查了账户密码不妨去看一下发送邮件的账户是否正确
![在这里插入图片描述](https://img-blog.csdnimg.cn/20200121200525345.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM1OTUzOTY2,size_16,color_FFFFFF,t_70)
可能是被qq把心态搞崩了吧
最后再把我的网易邮箱配置给贴出来
spring.mail.host=smtp.163.com
spring.mail.username=hufei1639670695@163.com
spring.mail.password=你的网易授权码
spring.mail.default-encoding=utf-8
spring.mail.properties.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
spring.mail.properties.mail.debug=true