8

我正在使用以下代码在 Yahoo 上发送电子邮件:-

    Properties   props1 = new Properties();
    EmailAuthenticator authenticator = new EmailAuthenticator(account);

        props1.setProperty("mail.transport.protocol", "smtps");
        props1.setProperty("mail.host", "smtp.mail.yahoo.com");
        props1.put("mail.smtp.auth", "true");
        props1.put("mail.smtp.port", "587");
           props1.put("mail.smtp.starttls.enable", "true");
        smtpSession = Session.getInstance(props1, authenticator);
              smtpSession.setDebug(true);

但是我javax.mail.MessagingException [EOF] 从过去 5 天开始就面临这个问题我的 LogCat 是:---

  Message-ID:<1082699080.2.1356082481793.JavaMail.javamailuser@localhost>
Subject: Hello
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
554 Transaction failed : Cannot send message due to possible abuse; please visit http://postmaster.yahoo.com/abuse_smtp.html for more information
 DEBUG SMTP: got response code 554, with response: 554 Transaction failed : Cannot send message due to possible abuse; please visit http://postmaster.yahoo.com/abuse_smtp.html for more information
RSET
DEBUG SMTP: EOF: [EOF]
javax.mail.MessagingException: [EOF]
com.sun.mail.smtp.SMTPTransport.issueCommand(SMTPTransport.java:1481)
 com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1512)
 com.sun.mail.smtp.SMTPTransport.finishData(SMTPTransport.java:1321)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:637)
   javax.mail.Transport.send0(Transport.java:189)
    javax.mail.Transport.send(Transport.java:118)
   com.privymo.javamail.EmailManager.sendMail(EmailManager.java:203)

请帮忙谢谢,

4

2 回答 2

1

错误回溯显示您收到 SMTP 错误消息:

554 交易失败:由于可能滥用而无法发送消息;请访问http://postmaster.yahoo.com/abuse_smtp.html了解更多信息

虽然那个特定的雅虎!页面无法访问,从消息中可以清楚地看出 Yahoo! 怀疑您的邮件可能是垃圾邮件并拒绝发送。雅虎中的一个线程!邮件帮助社区建议联系Yahoo! 邮寄客户服务以获取更多信息和帮助。

于 2012-12-21T10:50:38.357 回答
0

你有雅虎!邮件加号帐户?

来自 JavaMail常见问题解答

"Note that free Yahoo! Mail accounts do not allow POP3 or SMTP access. You must purchase a Yahoo! Mail Plus account to get POP3 and SMTP access."

于 2012-12-24T07:49:59.990 回答