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:
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
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!