While sending Email... I keep getting error:
530 5.7.1 Client was not authenticated
Initially I thought that the "fromaddress" that I am using requires an authentication. But that is not the case. It has been configured to send mail without any authentication. Then when I changed the configuration to enabled authentication, I am still getting the same error. I am putting the whole SMTP Debug as well as my code here. Note that my user id for authentication is same as "from address" i.e. xxxxx@abcd.com
DEBUG: setDebug: JavaMail version 1.4.1
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: trying to connect to host "192.168.21.223", port 25, isSSL false
220 MAIL1.XXXX.INT Microsoft ESMTP MAIL Service ready at Mon, 23 Jan 2012 18:23:56 +0200
DEBUG SMTP: connected to host "192.168.21.223", port: 25
EHLO venus02
250-MAIL1.XXXX.INT Hello [10.160.1.110]
250-SIZE
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-X-ANONYMOUSTLS
250-AUTH NTLM
250-X-EXPS GSSAPI NTLM
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250-XEXCH50
250-XRDST
250 XSHADOW
DEBUG SMTP: Found extension "SIZE", arg ""
DEBUG SMTP: Found extension "PIPELINING", arg ""
DEBUG SMTP: Found extension "DSN", arg ""
DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
DEBUG SMTP: Found extension "STARTTLS", arg ""
DEBUG SMTP: Found extension "X-ANONYMOUSTLS", arg ""
DEBUG SMTP: Found extension "AUTH", arg "NTLM"
DEBUG SMTP: Found extension "X-EXPS", arg "GSSAPI NTLM"
DEBUG SMTP: Found extension "8BITMIME", arg ""
DEBUG SMTP: Found extension "BINARYMIME", arg ""
DEBUG SMTP: Found extension "CHUNKING", arg ""
DEBUG SMTP: Found extension "XEXCH50", arg ""
DEBUG SMTP: Found extension "XRDST", arg ""
DEBUG SMTP: Found extension "XSHADOW", arg ""
DEBUG SMTP: Attempt to authenticate
NOOP
250 2.0.0 OK
DEBUG SMTP: use8bit false
MAIL FROM:<xxxxx@abcd.com>
530 5.7.1 Client was not authenticated
DEBUG SMTP: got response code 530, with response: 530 5.7.1 Client was not authenticated
RSET
DEBUG SMTP: EOF: [EOF]
javax.mail.MessagingException: [EOF]
at com.sun.mail.smtp.SMTPTransport.issueCommand(SMTPTransport.java:1481)
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1512)
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1055)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:634)
at com.pack.prod.infra.JFMailer.sendMail(JFMailer.java:843)
My Java code goes like this:
Any idea what I am doing wrong. Once again with authentication and no authentication, I keep getting this same error.
Regards,
Priyam