我使用以下代码发送电子邮件在雅虎: -
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);
Run Code Online (Sandbox Code Playgroud)
但我面临的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 …Run Code Online (Sandbox Code Playgroud)