Greetings, Can someone please expalain to me what do i need to have and how to configure java mail? I have javamail and JAF set to classpath, but nothing happens, i mean, no email is being sent. Do i actually need to have email server on my PC? I need some help here. Greatly appreciated, m,phx
Hi Zoe, I tested the "simplemail.jsp" example posted on this website. But I got an error, it says: Unknown SMTP host: smtp.mail.Rediff.com; nested exception is... I have two Rediff.com email acounts and they worked fine when I sent e-mail through the internet. Which "SMTP host" do you use? Do you know any other "SMTP host" I can use to test this example? Thank you very much. Juan Zhang
Try telnetting to your SMTP host, port 25, to verify that there is indeed an SMTP server listening there. If you're seeing a server hello then it's ok. If you're seeing an hourglass you have your mail server wrong. It is not possible to use a different mail server. To combat spamming and other abuse, mail servers generally don't accept mail from un-authenticated users outside their own domain. And if I knew any servers that did I certainly would not wish such information out on the streets. - Peter PS. In fact, that is not true. SMTP servers won't relay mail, i.e. they won't accept mail intended for other hosts.
Joined: Apr 19, 2001
Peter, Thank you very much for your reply. I tried other SMTP host like yahoo.com, but still got an error: javax.mail.MessagingException: Could not connect to SMTP host: smtp.mail.yahoo.com, port: 25.... I think the reason is that some Internet Service Provider (like Juno, Netzero, FunCow) block remote ports 53 and 25. I read an article talk about this. Thanks again,
[This message has been edited by Juan Zhang (edited November 06, 2001).]
Peter den Haan
Joined: Apr 20, 2000
Surely your ISP cannot block access to their own SMTP server. Without it, you wouldn't be able to send e-mail. - Peter
Joined: Apr 19, 2001
Peter, Thank you so much for your help. I really appreciate. Finally, the jsp mail works. Juan
[This message has been edited by Juan Zhang (edited November 17, 2001).] [This message has been edited by Juan Zhang (edited November 29, 2001).]
Glad you got the example working! Just thought I'd mention the tutorial has an FAQ: http://www.jspinsider.com/faq/javamail.view Many of the questions asked happened to be there too! It is also true that some ISP block port 25. Although these are usually the free internet providers. I have yet to see a paid service that blocks this port.
Jayson Falkner<br />firstname.lastname@example.org<br />Author of <a href="http://www.jspbook.com" target="_blank" rel="nofollow">Servlets and JavaServer Pages; the J2EE Web Tier</a>