转自:http://student.csdn.net/space.php?uid=51562&do=blog&id=13670
org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.163.com:25
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1138)
at org.apache.commons.mail.Email.send(Email.java:1163)
at com.newer.servlet.EmailServlet.doPost(EmailServlet.java:45)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: javax.mail.AuthenticationFailedException: failed to connect
at javax.mail.Service.connect(Service.java:322)
at javax.mail.Service.connect(Service.java:172)
at javax.mail.Service.connect(Service.java:121)
at javax.mail.Transport.send0(Transport.java:190)
at javax.mail.Transport.send(Transport.java:120)
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1128)
... 16 more
查了很多资料,终于解决了。
做发送邮件的这个功能基本上做了一天,从昨天中午开始一直到凌晨一点,还是没解决掉,人都快崩溃了,开始是mail.jar和activation.jar这两个包没有导入,导入后就报上面这个连接异常。早上4:00多醒来了,实在睡不着。起来打开电脑,突然想起昨晚临睡前看email协议,邮件服务器,pop3,smtp.程序实在找不出什么错误,灵光一闪,就进入邮箱账号看看邮箱设置,发现没有开启pop3.smtp服务。开启后,邮件就能发送成功了。
所以在做发送邮件的java,或者jsp测试前,一定要记得把邮箱的pop3.smtp服务开启。所以有时候你的程序根本没有错误,但就是会出现一些让你根本就想不到得错误,这时候就得看看与你程序相关的一些其它的服务是否与程序的运行有关了,邮件发送时是这样,还有一个web项目比较常见的是银行付款。
查了一些资料,163邮箱在2005年以后注册的邮箱没有提供pop3.smtp服务,只有付费邮箱才有这个功能。
因此最好是用QQ邮箱或者sina邮箱进行测试,并且记得一定要开启pop3.smtp服务。
希望能给像我一样在程序路上前进的朋友能有一些帮助,因为我找着错误的时候,网上的帖子基本上没讲到这个,就是本身程序以外的而有关第三方产品的服务而导致的异常
分享到:
相关推荐
主要介绍了javax.mail.SendFailedException: Sending failed问题原因,需要的朋友可以参考下
It places a much heavier burden on the mail server, requiring the server to receive the new messages, deliver them to users when requested, and maintain them in multiple folders for each user. ...
“{“success”:false,”message”:”错误System.Net.Mail.SmtpException: Failure sending mail. —> System.Net.WebException: The remote name could not be resolved: ‘smtp.163.com’ 分析: 邮件发送相关...
14. If the two ISPs do not peer with each other, then when they send traffic to each other they have to send the traffic through a provider ISP (intermediary), to which they have to pay for carrying ...
说到发送邮件发送,先提一下SMTP(呵呵,高手就跳过这一段吧!)。 SMTP的全称是“Simple Mail Transfer Protocol”,即简单邮件传输协议。它是一组用于从源地址到目的地址传输邮件的规范,通过它来控制邮件的中转方式...
Here is the method CTestEmailDlg::OnSend method, which is used to pass the user specified information to the email object and call the IMail::Send method after setting everything. Collapse | Copy ...
在Oracle 11.2.0.4中调用 javax.mail 发送邮件时可能会遇到以下错误: ORA-29532: Java call terminated by uncaught Java exception: javax.mail.MessagingException: IOException while sending message; nested ...
Sending E-Mail 191 Making URL Connections 196 Chapter 4: Database Programming 217 The Design of JDBC 218 The Structured Query Language 222 JDBC Configuration 227 Executing SQL Statements 232 ...
Some java code for sending email, If you want this send me email at : sunjunbin@gmail.com
10: Sending and Receiving Mail 11: File System Integration 12: Web Services Part 4 - Advanced Topics 13: Monitoring and Management 14: Managing scheduling and concurrency 15: Spring ...
安装Visual Studio 2012 Express之后,双击打开web.config文件时经常出现“There was a problem sending the command to the program”的错误,然后VS2012 Express打开了,但web.config文件没打开,需要再次双击web....
We're doing it like everyone does: sending an e-mail to the user, and waiting for the user to click a link. The only validation we do is to check the e-mail with usual regex... but we need to go a ...
JavaMail API 实现实现用于从 Web 浏览器发送电子邮件的 JavaMail API。项目环境: Java JDK 1.8 Apache Maven 3.3.1 弹簧框架 4.1.6 JavaMail API 1.4.7 Apache Tomcat 8 Eclipse月神 4.4 Log4j 1.2.17 SLF4J ...
Chapter 11: Sending E-mail Chapter 12: User Logins, Profiles, and Personalization Chapter 13: Building a Content Management System Chapter 14: Mailing Lists Chapter 15: Online Stores Chapter 16: ...
I would like to thank the following people for taking the time to explain things that were unclear to me and for proofreading the document. Andrey A. Chernov Bruce A. Mah Dag-Erling Smørgrav ...
receiving messages can be connected to the server in a very easy way - by using the word "localhost" instead of your current SMTP host. Having done so, you can send messages in a usual manner. Free ...
Sending the contents of a webpage with images as an HTML mail.
versions are available, please subscribe to the mailing list by sending a blank email to the following address: ritlabs-news-en-join@mailing.ritlabs.com The Bat! has the MailTicker™ included, that ...
http://stackoverflow.com/questions/2020088/sending-email-in-android-using-javamail-api-without-using-the-default-android-app的源码,已实现可发送邮件。
Read the article Android: Sending Email using Intents if you want to learn what motivated the creation of this library. Usage Creating a simple email intent is as easy as this: Intent emailIntent = ...