Error 530 Access denied : Free users cannot access this server. in java mail?
Error 530 Access denied : Free users cannot access this server. in java mail? … i have made prog in java using java mail api now when i am send email it throws following error
Exception in thread "main" javax.mail.Authentication: 530 Access denied : Free users cannot access this server.
at com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(SMTPTransport.java:648)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:583)
at javax.mail.Service.connect(Service.java:313)
at javax.mail.Service.connect(Service.java:172)
at javax.mail.Service.connect(Service.java:121)
at javax.mail.Transport.send0(Transport.java:190)
at javax.mail.Transport.send(Transport.java:120)
at SendApp_one.send(SendApp_one.java:36)
at SendApp_one.main(SendApp_one.java:56)
My Source Code is below :
import java.io.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;
public class SendApp_one
{
private static final String SMTP_AUTH_USER =MyYahooUsename;
private static final String SMTP_AUTH_PWD =Myyahoopassword;
public void send(String smtpHost,String from, String to,String subject, String content)
throws AddressException, MessagingException
{
// Create a mail session
java.util.Properties props = new java.util.Properties();
props.put("mail.smtp.host", smtpHost);
props.put("mail.debug", "false");
props.put("mail.smtp.auth", "true");
Authenticator auth= new SMTPAuthenticator();
Session session = Session.getInstance(props,auth);
session.setDebug(true);
// Construct the message
Message msg = new MimeMessage(session);
msg.setFrom(new InternetAddress(from));
msg.setRecipient(Message.RecipientType.TO, new InternetAddress(to));
msg.setSubject(subject);
msg.setText(content);
// Send the message
Transport.send(msg);
System.out.println("Email Has Been Send !…");
}
private class SMTPAuthenticator extends javax.mail.Authenticator
{
public PasswordAuthentication getPasswordAuthentication()
{
String username =SMTP_AUTH_USER;
String password =SMTP_AUTH_PWD;
return new PasswordAuthentication(username, password);
}
}
public static void main(String[] args) throws Exception {
// Send a test message
SendApp_one obj=new SendApp_one();
String subject=new String(""+args[0]);
String text=new String(""+args[1]);
obj.send("smtp.mail.yahoo.com","Yahooid", "YahooId",subject,text);
}
}
plz give me solution plz …………………….
Thanks…..
Yahoo do not offer SMTP and POP mail service to free account users. You need to buy Yahoo Mail PLUS service.
http://answers.yahoo.com/question/index?qid=20060918091416AAIyC6m
http://overview.mail.yahoo.com/enhancements/mailplus
—
Kasey C, PC guru since Apple II days
Always remember you're unique, just like everyone else.
[…]