• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks ...
i have solved my problem...
 
Time flies like an arrow. Fruit flies like a banana. Steve flies like a tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic