• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Devaka Cooray
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
Bartenders:

JavaMail SMTP address

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
for sending mails change your code as below
Properties props = System.getProperties();
props.put("mail.smtp.host", "smtp.se.mediaone.net");
Let me know if it helps
Ajan
 
Yeah, but is it art? What do you think tiny ad?
Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders
https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing
reply
    Bookmark Topic Watch Topic
  • New Topic