File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other JSE/JEE APIs and the fly likes JavaMail - Unable to relay though Authentication specified Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "JavaMail - Unable to relay though Authentication specified" Watch "JavaMail - Unable to relay though Authentication specified" New topic
Author

JavaMail - Unable to relay though Authentication specified

James Gordon
Ranch Hand

Joined: Aug 09, 2002
Posts: 106
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
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

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

Joined: Aug 09, 2002
Posts: 106
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
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Okay. So as I said, ask the administrator of the server to help you out. There may be more information in the server logs.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JavaMail - Unable to relay though Authentication specified
 
Similar Threads
javax.mail.NoSuchProviderException: smtp
Sending mail through Java
cannot send email through Outlook
Sending mail with authentication to Exchange Server 2007
External Mail "javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart"