I am not able to send Yahoo Mail from Java Mail Api
Asked Answered
L

2

7

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,

Lundquist answered 21/12, 2012 at 9:40 Comment(2)
Not sure but check whether you are passing uerid,pwd properly for accessing the mail service (sending mail)Urus
username & password are rightLundquist
S
1

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.

Sweatt answered 21/12, 2012 at 10:50 Comment(2)
m still not understand. What shoud i do? I have seen this link but I am not able for any helpLundquist
That error message is specific to Yahoo!'s SMTP servers. You should use the Customer Care link I posted in my answer to contact Yahoo! directly to find out why your email message is being blocked by the server.Sweatt
P
0

Do you have a Yahoo! Mail Plus account?

From JavaMail FAQ:

"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."

Priesthood answered 24/12, 2012 at 7:49 Comment(4)
Your concept right But I want to ask one thing that in starting i have send mail on yahoo from this code . one day work fine & after that i got this error why?Lundquist
try 465 as port instead of 587Priesthood
I have check 465,25,587 still not successLundquist
I think it's clear from the first line that Javamail is only capable with Yahoo! Mail Plus Accounts.Priesthood

© 2022 - 2024 — McMap. All rights reserved.