dcsimg
Using JavaMail 1.2, can't send email using Authenticated SMTP on MS Exchange Server 5.5
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Jeremy_Torres
Posted On:   Thursday, May 16, 2002 02:45 PM

JavaMail 1.2 I'm trying to send email using SMTP Authentication on MS Exchange (5.5). I have read through the JavaMail forum and I believe I have set everything up correctly. I get an authentication successful from the server and then get an AuthenticationFailedException Any suggestions/help would be greatly appreciated. Here's the code snippet used: Properties props = new Properties(); props.setProperty("mail.smtp.host", mailhost); props.setProperty("mail.smtp.auth", "true"); ... Transport transport = session.getTransport("smtp"); transport.connect(mailhost, username, passwo   More>>


JavaMail 1.2

I'm trying to send email using SMTP Authentication on MS Exchange (5.5). I have read through the JavaMail forum and
I believe I have set everything up correctly. I get an authentication successful from the server and then get an
AuthenticationFailedException Any suggestions/help would be greatly appreciated.


Here's the code snippet used:


			
Properties props = new Properties();
props.setProperty("mail.smtp.host", mailhost);
props.setProperty("mail.smtp.auth", "true");

...

Transport transport = session.getTransport("smtp");
transport.connect(mailhost, username, password);

...

// Call save changes
message.saveChanges();

transport.send(msg);








The following is the debug output:



			
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth true

DEBUG: SMTPTransport trying to connect to host "192.168.1.22", port 25

DEBUG SMTP RCVD: 220 someserver.com ESMTP Server (Microsoft Exchange Internet Mail Service 5.5.2653.13) ready

DEBUG: SMTPTransport connected to host "192.168.1.22", port: 25

DEBUG SMTP SENT: EHLO DIALBEANSFORD
DEBUG SMTP RCVD: 250somserver.com Hello [server]
250-XEXCH50
250-HELP
250-ETRN
250-DSN
250-SIZE 0
250-AUTH LOGIN
250 AUTH=LOGIN

DEBUG SMTP Found extension "XEXCH50", arg ""
DEBUG SMTP Found extension "HELP", arg ""
DEBUG SMTP Found extension "ETRN", arg ""
DEBUG SMTP Found extension "DSN", arg ""
DEBUG SMTP Found extension "SIZE", arg "0"
DEBUG SMTP Found extension "AUTH", arg "LOGIN"
DEBUG SMTP Found extension "AUTH=LOGIN", arg ""
DEBUG SMTP: Attempt to authenticate
DEBUG SMTP SENT: AUTH LOGIN
DEBUG SMTP RCVD: 334 VXNlcm5hbWU6

DEBUG SMTP SENT: Y2thdG9uYQ==
DEBUG SMTP RCVD: 334 UGFzc3dvcmQ6

DEBUG SMTP SENT: MTk5OA==
DEBUG SMTP RCVD: 235 LOGIN authentication successful

DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth true
Exception in thread "main" javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.AuthenticationFailedException
at javax.mail.Transport.send0(Transport.java:219)
at javax.mail.Transport.send(Transport.java:81)
at MailLoader.sendMail(MailLoader.java:75)
at MailLoader.main(MailLoader.java:139)
   <<Less
About | Sitemap | Contact