• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

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

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));
new InternetAddress(to));
message.setSubject("Hello, JDC");
message.setText("Welcome to the JDC");
// 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...
navik pathak
Ranch Hand
Posts: 15304
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks ...
i have solved my problem...
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!