Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaMail - Unable to relay though Authentication specified

 
James Gordon
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

My java mail code doesn't seem to be able to send out to external email addresses.
It only work for internal email addresses.
I'd set the authentication though.

To verify that it's code issue, I tried with Outlook Express instead.
I provide the same exact account information and authentication for outgoing mail.
It works with the mail client.

I'd reviewed my code few times but didn't see anything wrong.
Could someone please point out if there's any issues with my code.


Thanks in advance.






DEBUG: setDebug: JavaMail version 1.3.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: useEhlo true, useAuth true
DEBUG SMTP: trying to connect to host "192.1.1.31", port 25

220 RALD.xxx.com Microsoft ESMTP MAIL Service ready at Tue, 11 Sep 2012 15:16:38 +0800
DEBUG SMTP: connected to host "192.1.1.31", port: 25

EHLO ROY
250-RALD.xxx.com Hello [192.1.1.20]
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
DEBUG SMTP: use8bit false
MAIL FROM:<admin@xxx.com>
250 2.1.0 Sender OK
RCPT TO:<recipient@yyy.com>
550 5.7.1 Unable to relay
DEBUG SMTP: Invalid Addresses
DEBUG SMTP: sender@xxx.com
DEBUG SMTP: Sending failed because of invalid destination addresses
RSET
250 2.0.0 Resetting
QUIT
 
Paul Clapham
Sheriff
Posts: 21133
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DEBUG SMTP: Sending failed because of invalid destination addresses


This is the message which tells you about the problem. (Note that authenticating yourself to the server won't make an invalid destination address suddenly be valid.) If you still don't understand the problem, though, your best bet is to ask the administrator of your SMTP server to help you out.
 
James Gordon
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Paul,

The target email address is definitely valid and I've been using it for the past 10 years.
As mentioned, Outlook Express managed to send it out.
 
Paul Clapham
Sheriff
Posts: 21133
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay. So as I said, ask the administrator of the server to help you out. There may be more information in the server logs.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic