欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

阿里云 ECS 使用 smtp.163.com 发送电子邮件失败,如何修复?

最编程 2024-07-11 17:34:18
...

1、邮件发送程序运行时报超时,但是ping smtp.163.com是OK的。
org.springframework.mail.MailSendException: Mail server connection failed; nested exception is com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.163.com, 25; timeout -1;
nested exception is:

    java.net.ConnectException: Connection timed out (Connection timed out). Failed messages: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.163.com, 25; timeout -1;

nested exception is:

    java.net.ConnectException: Connection timed out (Connection timed out); message exception details (1) are:

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

    java.net.ConnectException: Connection timed out (Connection timed out)

2、本地电脑运行正常可以发送邮件,但是部署到ecs服务器上运行就提示超时,ecs防火墙有拦截吗?