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