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源码的地方
[color=red]通过oracle官网的搜索功能[/color],找到页面[url=http://www.oracle.com/technetwork/java/javamail/faq-135477.html]javamail api faq[/url],其中有下载源码的问题:如下,然后根据相应提示,下载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. [color=red]Previous releases of JavaMail are also available as part of Project GlassFish[/color]. See the mail module page at GlassFish for more details.
[url=http://www.oracle.com/technetwork/java/javamail/index-138643.html]javamail 官网下载地址[/url]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值