SMTP客户端程序给出运行时错误

时间:2012-03-29 14:56:32

标签: java smtp javamail

我可以编译我的代码但不能执行。可能是什么原因以及如何对其进行排序?我收到以下运行时错误。

C:\>java SMTPClient
Exception in thread "main" javax.mail.MessagingException: Could not connect to S
MTP host: smtp.mail.yahoo.com, port: 465;
nested exception is..................etc</b></code>

4 个答案:

答案 0 :(得分:2)

请提供例外的root causeStack trace。 可能是因为您尚未配置Authenticator

答案 1 :(得分:2)

可能SMTPClient使用SMTP协议,但雅虎使用更安全的协议,如ASMTP。你可以在这里发布你的SMTPClient课程吗?

答案 2 :(得分:2)

答案 3 :(得分:1)

原因是它无法连接到Yahoo Mail Server。我不确定雅虎的邮件端口,所以要确保端口正确。你能发布更多细节吗?即嵌套异常....

相关问题