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:
to allow relaying from our app servers. Hopefully this helps, if you are using a specific mail server let me know.