SMTPTransport.sendMessage exception

K

Kez

I am getting the following exception in my code:

javax.mail.SendFailedException: 5.5.2 No valid recipients
at gnu.mail.providers.smtp.SMTPTransport.sendMessage(Unknown
Source)
at javax.mail.Transport.send0(Transport.java:151)
at javax.mail.Transport.send(Transport.java:80)

I have 3 servers set up using this code, and only one of them gets this
error, so I expect it is a configuration issue.

I have checked the recipient is valid.

Any ideas what may be causing this?
Would this occur if the mail server was configured not to accept emails
being sent through it, or if the email server couldn't be contacted? I
would expect a different error in both of these cases.

Kerrin
 
N

Nigel Wade

Kez said:
I am getting the following exception in my code:

javax.mail.SendFailedException: 5.5.2 No valid recipients
at gnu.mail.providers.smtp.SMTPTransport.sendMessage(Unknown
Source)

What is this package? I'm not familiar with it. Is it reliable?

at javax.mail.Transport.send0(Transport.java:151)
at javax.mail.Transport.send(Transport.java:80)

I have 3 servers set up using this code, and only one of them gets this
error, so I expect it is a configuration issue.

I have checked the recipient is valid.

Any ideas what may be causing this?
Would this occur if the mail server was configured not to accept emails
being sent through it, or if the email server couldn't be contacted? I
would expect a different error in both of these cases.

Kerrin

It looks to me as though that particular server is failing to verify the
recipients correctly.

You seem to be connecting to the mail server, otherwise I'd expect a TCP related
error message. It's certainly possible that a mail server set up to not allow
relaying could give that error, if the recipients were not local. It's also
possible that it's a broken SMTP transport handler you are using.

I'd say you should check your mail server configuration, and logs to see if they
shed any light on the issue. If you can capture packets between the client and
the server that might help, the SMTP protocol is pretty simple (as its name
implies) and it should be fairly trivial to spot any errors in that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,809
Latest member
moe77

Latest Threads

Top