• Post Reply Bookmark Topic Watch Topic
  • New Topic

Error In Sending Mail To Yahoo???Got Exception About Pop Authentication While sending

 
navik pathak
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friend,
I am new to JavaMail and i am trying to send mail but could not make it. i got error about POP authentication when i am sending mail how this error comes in sending mail...
import java.util.Properties;
import javax.mail.*;
import javax.mail.internet.*;
public class JDCSend {
public static void main (String args[])
throws Exception {
String smtpHost = args[0];
String from = args[1];
String to = args[2];
// Get system properties
Properties props = System.getProperties();
// Setup mail server
props.put("mail.smtp.host", smtpHost);

// Get session
Session session =
Session.getDefaultInstance(props, null);
// Define message
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress(from));
message.addRecipient(Message.RecipientType.TO,
new InternetAddress(to));
message.setSubject("Hello, JDC");
message.setText("Welcome to the JDC");
// Send message
Transport.send(message);
}
}
i am using above code,....and running the prog like
java JDCSend smtp.mail.yahoo.com navik232@yahoo.com navik232@yahoo.com but got error like
javax.mail.SendingFailed and another nested Exception javax.mail.MessaginException:530 popauthentication required........
so what to do in that....
pls help me...
thanks
navik pathak
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
More than likely the problem is because yahoo requires some sort of authentication in order to use thier SMTP service. I doubt just anyone can send their mail through Yahoo's SMTP Server. So it is probably failing because it is not authenticating correctly.
There is an Authenticator class that you could use to resolve this problem. However, you will never be able to retrieve your mail from Yahoo because JavaMail does not support web based E-mail as of yet.
 
navik pathak
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks ...
i have solved my problem...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!