首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网络技术 > 网络基础 >

javax.mail.MessagingException: [EOF]处置

2012-09-09 
javax.mail.MessagingException: [EOF]处理项目中使用Javamail发送邮件时报上述错误,去oracle官网下载java

javax.mail.MessagingException: [EOF]处理
项目中使用Javamail发送邮件时报上述错误,去oracle官网下载javamail的源码调试。
调试后发现,出上述错误的根本原因是,SMTPTransport在做mailfrom的时候,服务器返回错误提示消息:553 sorry, your domain isn't in my list of allowed rcpthosts.
检查邮件服务器,发现支持smtp,后发现mailfrom的地址在邮件服务器不存在,换了个真实存在的地址后,问题解决。

msg.setFrom(new InternetAddress("real@xxx.com"));


刚开始在oracle官网中找不到下载javamail源码的地方
通过oracle官网的搜索功能,找到页面javamail api faq,其中有下载源码的问题:如下,然后根据相应提示,下载glassfish-v2.1.1-b31g-src后,发现其中包含的javamail的源码和项目中使用的一致!(在百度下来最javamail 1.4.3的源码,调试的时候发现代码不一致,完全没办法调试!)
Q: Can I get the source code for the JavaMail API implementation?
A: Starting with JavaMail 1.4.2, the source code for the JavaMail API Reference Implementation is available under the CDDL or GPL open source licenses in the JavaMail project at Kenai. You'll need Mercurial to check out the source code. Previous releases of JavaMail are also available as part of Project GlassFish. See the mail module page at GlassFish for more details.
javamail 官网下载地址

热点排行