Link to home
Start Free TrialLog in
Avatar of KNVB HK
KNVB HKFlag for Hong Kong

asked on

Java mail and MS SMTP server authentication problem

I have put "mail.smtp.auth" properties "true" in my program.
I am using IIS4 's SMTP server to send email.
I can send email successfully, when I disable the authentication.
Here are my debug messages:
DEBUG SMTP: Attempt to authenticate
DEBUG SMTP SENT: AUTH LOGIN
DEBUG SMTP RCVD: 334 VXNlcm5hbWU6

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

DEBUG SMTP SENT: YWJjMTIz
DEBUG SMTP RCVD: 235 Authentication successful


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

It shows everything ok, however, I got the following exception from my application:
javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.AuthenticationFailedException

Would you tell me why?
ASKER CERTIFIED SOLUTION
Avatar of gandalf94305
gandalf94305

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of KNVB HK

ASKER

I found it works when I change the relay server to my ISP mail server.