Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I am not able to send Yahoo Mail from Java Mail Api

I am using following code for sending Email On 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);

But I am facing javax.mail.MessagingException [EOF] I am facing this Problem from Last 5 days My LogCat is:---

  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)

Please Help Thanks,

like image 604
user1921139 Avatar asked Dec 21 '12 09:12

user1921139


People also ask

Does SMTP support Yahoo?

If you have a Yahoo Mail account, the Yahoo SMTP server lets you configure your email clients and websites to send emails using your Yahoo Mail account. For configuring an email client, you can also use POP3 or IMAP to import your Yahoo Mail emails to your email client to send and receive emails from the client.

What is SMTP server name for Yahoo?

Yahoo Mail SMTP Server / Hostname: smtp.mail.yahoo.com. SMTP Port Number: 465 or 587. Encryption: TLS/ SSL.

How do you send an email from a Java program?

Create a new session object by calling getDefaultInstance() method and passing properties as argument to get all of the important properties like hostname of the SMTP server etc. Create a MimeMessage object by passing the session object created in previous step. The final step is to send email using the javax. mail.


1 Answers

The error traceback shows that you are getting a SMTP error message:

554 Transaction failed : Cannot send message due to possible abuse; please visit http://postmaster.yahoo.com/abuse_smtp.html for more information

While that specific Yahoo! page is not accessible, it is clear from the message that Yahoo! suspects that your message might be spam and is refusing to deliver it. A thread in the Yahoo! Mail Help Community suggested contacting Yahoo! Mail Customer Care for more information and assistance.

like image 164
Martey Avatar answered Oct 20 '22 21:10

Martey