开发者社区 问答 正文

邮件发送不成功

你好,我在阿里云服务器Centos系统上用Java代码发送邮件,是263的邮箱,发送不成功,在别的centos服务器上都可以发送成功,请问为什么?
错误提示:
com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.263.net, 25; timeout -1;
  nested exception is:
    java.net.ConnectException: Connection timed out
    at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2118)
    at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:712)
    at javax.mail.Service.connect(Service.java:366)

展开
收起
很久 2017-11-24 10:10:31 2752 分享
分享
版权
举报
1 条回答
写回答
取消 提交回答
  • 问题总能找到解决方案的

    建议先检查下安全组中的端口号是否可用。若安全组配置正常,可检查ecs本身的防火墙是否有对端口做了禁用:

    iptables status
    

    若被禁用了可以开放端口:

    iptables -I INPUT -p tcp --dport 25 -j ACCEPT
    
    2023-07-20 13:59:43 举报
    赞同 评论

    评论

    全部评论 (0)

    登录后可评论
问答分类:
问答地址:
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等