pokam dummy mioche

Inscrit le: 15 Juil 2004 Messages: 1
|
Posté le: Jeu Juil 15, 2004 10:37 am Sujet du message: code pour envouyer un mail |
|
|
j'ai écrit un code pour envoyer un mail de l'utilisateur abc@yaho.com à l'utilisateur cde@yahoo.com
mais quand j'execuse mon code j'obtient le méssage suivant
DEBUG: setDebug: JavaMail version 1.3.1
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.s
mtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: trying to connect to host "smtp.mail.yahoo.com", port 25
220 smtp002.mail.ukl.yahoo.com ESMTP
DEBUG SMTP: connected to host "smtp.mail.yahoo.com", port: 25
EHLO gilabo1pc7
250-smtp002.mail.ukl.yahoo.com
250-AUTH LOGIN PLAIN
250-PIPELINING
250 8BITMIME
DEBUG SMTP: Found extension "AUTH", arg "LOGIN PLAIN"
DEBUG SMTP: Found extension "PIPELINING", arg ""
DEBUG SMTP: Found extension "8BITMIME", arg ""
DEBUG SMTP: Attempt to authenticate
AUTH LOGIN
334 VXNlcm5hbWU6
cG9rYW1ibA==
334 UGFzc3dvcmQ6
MTk3OQ==
535 authorization failed (#5.7.0)
MessagingException : null
voici mon code
import java.util.Properties;
import javax.mail.*;
import javax.mail.internet.*;
public class abc
{
public static void main (String args[ ]) throws Exception
{
String host = "SMTP.mail.yayoo.com";
String from = "abc@yahoo.com";
String to = "cde@yahoo.com";
String username = "abc";
String password = "password";
try
{
Properties props = System.getProperties();
props.put("mail.smtp.host", host);
props.put("mail.smtp.auth", "true");
Session session = Session.getDefaultInstance(props, null);
session.setDebug(true);
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress(from));
message.addRecipient(Message.RecipientType.TO,
new InternetAddress(to));
message.setSubject("Hello JavaMail");
message.setText("Welcome to JavaMail");
Transport transport = session.getTransport("smtp");
transport.connect(host, username, password);
transport.sendMessage(message,message.getAllRecipients());
transport.close(); }
catch (MessagingException mse)
{
System.out.println("MessagingException : "+mse.getMessage());
}
}
}
comment faire
s'il vous plait aider moi
merci |
|