send mail problem - relaying error
2 posts in topic
Flat View  Flat View

Posted By:   Prasad_Shindikar
Posted On:   Saturday, April 8, 2006 02:21 AM

Hi all,

I have provided the correct user,passwd,host.

This is the error i am getting -

javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.SendFailedException: Invalid Addresses;
nested exception is:
javax.mail.SendFailedException: 530 5.7.1 Relaying not allowed: ps231@rediffmail.com

Pl tell me how can i solve the problem

Re: send mail problem - relaying error

Posted By:   Dhananjay_Patkar  
Posted On:   Monday, June 12, 2006 11:45 PM


usually mail servers need authentication before sending or receivimg mails thus you need to set authentication as true

The following property needs to be set to true

props.put("mail.smtp.auth", "true");

Thanks & regards,


Re: send mail problem - relaying error

Posted By:   Bryan_Conzone  
Posted On:   Monday, May 8, 2006 07:18 PM

The relaying issue is a fairly common problem. Usually this is a problem with your SMTP server and not the java application that is using javamail. It sounds like your app is finding the SMTP server just fine.

The relaying problem usually occurs when the server that your application resides on does no have rights on the SMTP server to send messages. Relaying is usually done without authentication in a basic sense, so mail servers usually limit relaying only to requests coming from the same box or localhost by default, to prevent having this public server sitting out there that anyone can send messages through.

Are you running your own mail SMTP server or using someone elses?

If you are running your own, what mail server? You probably just need to find the config and add the IP addresses of any machine in your network that you want to allow relaying or enable relaying if it's not turned on.

For example, we primarily are using JAMES Apaches Mail Server (http://james.apache.org/index.html). To resolve the relaying problem which we also initially had there were a couple lines in the config that originally looked like the following:

that we changed to:,192.158.1.*

to allow relaying from our app servers. Hopefully this helps, if you are using a specific mail server let me know.
About | Sitemap | Contact