wood burning stoves 2.0*
The moose likes Servlets and the fly likes JavaMail SMTP address Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "JavaMail SMTP address" Watch "JavaMail SMTP address" New topic
Author

JavaMail SMTP address

Greg Kearney
Greenhorn

Joined: Sep 02, 2000
Posts: 7
I created a JSP that uses javamail, without any luck.

I think my problem has to do with SMTP addresses. My connection to the internet is a cablemodem and I use Netscape for my browser.
I got the following address from my Outlook configuration:

Incoming mail (POP3): pop.se.mediaone.net
Outgoing mail (SMTP): smtp.se.mediaone.net

The statement in which I put the above address:

props.put("smtp.se.mediaone.net", "pop.se.mediaone.net");

I have tried every combination of the addresses and most of the time I get the following message:

javax.mail.SendFailedException: Sending failed; nested exception is: javax.mail.SendFailedException: Invalid Addresses; nested exception is:
javax.mail.SendFailedException: 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)

Do you have any ideas?
Thanks
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
Originally posted by Greg Kearney:
I created a JSP that uses javamail, without any luck. [...]
The statement in which I put the above address:
props.put("smtp.se.mediaone.net", "pop.se.mediaone.net");

Don't want to be nasty or anything, but have you actually thought about what are you trying to do here? Take a peek in the JavaDoc for Properties and you'll see that you're setting a property with the name "smtp.se.mediaone.net" to the value "pop.se.mediaone.net". How on Earth is that ever going to work, how is JavaMail going to find that property in the first place!
But seeing the forum you posted this in you may have been looking in the wrong documentation. This has nothing to do with Servlets or JSPs. You need the JavaMail docs.
But not to sound like a complete curmudgeon:
javax.mail.SendFailedException: Sending failed; nested exception is: javax.mail.SendFailedException: Invalid Addresses; nested exception is:
javax.mail.SendFailedException: 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)

Do you have any ideas?

Sure. You're not setting any mail server property recognisable to JavaMail, so it uses defaults which are, to quote the documentation, unlikely to work in all cases. From the looks of it, it defaults to a mail server somewhere on the net that, of course, will not relay your mail.
The same JavaDoc (javax.mail.Session) tells you it is expected that the client supplies values for the properties listed in Appendix A of the JavaMail spec (particularly mail.store.protocol, mail.transport.protocol, mail.host, mail.user, and mail.from).
Try props.setProperty("mail.host", "smtp.se.mediaone.net") for a start (or set the property on the command line so it is in System.getProperties()). Assuming you are using SMTP that might already work, or else have a go at Appendix A of the spec (downloadable from Sun).
- Peter
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
Java Mail questions really belomg in the "Other Java APIs" forum, so I've moved this message.
Note that there is a book promotion going on there right now, so if you carry on this discussion you may even get to win a book!


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
 
GeeCON Prague 2014
 
subject: JavaMail SMTP address