1、需要开启客户端授权码
授权码开启
https://blog.csdn.net/jinwufeiyang/article/details/76400708?locationNum=7&fps=1
如果没有授权码,后台会报错:
javax.mail.AuthenticationFailedException: 550 User has no permission
2、需要使用加密端口,465或587
https://blog.csdn.net/qq_21647977/article/details/77743808
如果使用25等端口,后台会报错:
javax.mail.MessagingException: Could not connect to SMTP host: smtp.qq.com, port: 25;
javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
3、需要关闭防火墙。