Erreur 530 Accès refusé : Les utilisateurs libres ne peuvent pas accéder à ce serveur. dans java mail ?
Erreur 530 Accès refusé : Les utilisateurs libres ne peuvent pas accéder à ce serveur. dans java mail ? ... j'ai fait un prog en java en utilisant l'api java mail et maintenant quand j'envoie un email il y a l'erreur suivante
Exception dans le thread "main" javax.mail.Authentication : 530 Accès refusé : Les utilisateurs libres ne peuvent pas accéder à ce serveur.
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)
Mon code source est le suivant :
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)
jette AddressException, MessagingException
{
// Créer une session de courrier électronique
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) ;
// Construire le message
Message msg = nouveau MimeMessage(session) ;
msg.setFrom(new InternetAddress(from)) ;
msg.setRecipient(Message.RecipientType.TO, new InternetAddress(to)) ;
msg.setSubject(subject) ;
msg.setText(content) ;
// Envoyer le message
Transport.send(msg) ;
System.out.println("L'email a été envoyé !...") ;
}
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 {
// Envoi d'un message test
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) ;
}
}
Veuillez me donner la solution .........................
Merci .....
Yahoo n'offre pas de services SMTP et POP aux utilisateurs de comptes gratuits. Vous devez acheter le service Yahoo Mail PLUS.
http://answers.yahoo.com/question/index?qid=20060918091416AAIyC6m
http://overview.mail.yahoo.com/enhancements/mailplus
-
Kasey C, gourou du PC depuis l'époque de l'Apple II
N'oubliez jamais que vous êtes unique, comme tout le monde.
I've had the same problem for some days while trying to send email from Opera Mail. Now my configuration is server smtp.mail.yahoo.com on port 465 and is working fine.
Hope it helps
Sergio
Clause de non-responsabilité - Les opinions exprimées dans cet article sont fournies par un tiers et peuvent ne pas correspondre à celles de notre site web.
