日期:2014-05-17  浏览次数:21009 次

使用java mail发送邮件报告的错误,请高手指点一二
[[SendMailProcessor:sendMail()] ERROR [3548 send fail. Exception: org.apache.commons.mail.EmailException: Sending the email to the following server failed : 192.168.2.211:25]
org.apache.commons.mail.EmailException: Sending the email to the following server failed : 192.168.2.211:25
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:873)
at org.apache.commons.mail.Email.send(Email.java:898)
at com.ait.mail.SendMailProcessor.sendMail(SendMailProcessor.java:120)
at com.ait.mail.SendMailProcessor.processMail(SendMailProcessor.java:58)
at com.ait.mail.SendMailTask.run(SendMailTask.java:28)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Caused by: javax.mail.MessagingException: Could not connect to SMTP host: 192.168.2.211, port: 25;
  nested exception is:
java.net.ConnectException: Connection timed out: connect
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1282)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)
at javax.mail.Service.connect(Service.java:297)
at javax.mail.Service.connect(Service.java:156)
at javax.mail.Service.connect(Service.java:105)
at javax.mail.Transport.send0(Transport.java:168)
at javax.mail.Transport.send(Transport.java:98)
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:863)
... 6 more
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:519)
at java.net.Socket.connect(Socket.java:469)
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:232)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1250)
... 13 more

------解决方案--------------------
我前段时间用java写了一个收发邮件的小程序,如果需要的话,给个邮箱我发给你。
------解决方案--------------------
SMTP host
你邮箱定义的smtp有问题 不如用网上的 比如qq sina什么的
报错显示无法连接 超时

------解决方案--------------------
192.168.2.211:25?这是哪儿的地址端口,看着就像个内网地址,你确定你能访问吗?telnet一下,ping一下。排除地址无法连接的错误
------解决方案--------------------
25端口是非SSL端口,994是SSL端口
------解决方案--------------------
192.168.2.211是内网的邮件服务器?
可能连接有问题
------解决方案--------------------
探讨
192.168.2.211:25?这是哪儿的地址端口,看着就像个内网地址,你确定你能访问吗?telnet一下,ping一下。排除地址无法连接的错误

------解决方案--------------------
错误写的很明显啊 SMTP邮件服务器 登录不上。 账号密码问题?网络问题?楼主 仔细看看吧
------解决方案--------------------
192.168.2.211:25
1. ip或端口不通
2. 不能访问
3. 其上邮件服务器配置有问题
------解决方案--------------------
Could not connect to SMTP host

连接不到stmp 
原因1:stmp服务错误
2:你的用户名或密码有问题