posted 16 years ago
The problem here is more than likely to be authentication related. To send to an external email address you often need to authenticate your request.
When I hit similar problems a while ago, the way I authenticated (there may be other ways) was to add a property to the request.
You probably have something like:
Properties prop = new Properties();
prop.put("mail.smtp.host",host);
For authentication you also need to add:
prop.put("mail.smtp.auth","true");
Then when you use the Transport to send the message use the method:
Transport trans = session.getTransport(transportType);
...
trans.connect(host,user,password);
trans.sendMessage(msg,msg.getAllRecipients());
Another option for my org was to configure the email server to allow relay without authentication from selected hosts. Thats a question for your server admins.