Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaMail SMTP address

 
Greg Kearney
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic