Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java mail configuration???

 
mocca az
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Rehan Malik
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to have access to a SMTP server to send the mail. There may be a few free providers but you'll have to look around.
 
Zoe Peng
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
take a look @this http://www.jspinsider.com/tutorials/jsp/javamail/jspjavamail_installation.view
I tested this before, it works for me.
 
Juan Zhang
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Juan Zhang
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,

Juan Zhang

[This message has been edited by Juan Zhang (edited November 06, 2001).]
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Surely your ISP cannot block access to their own SMTP server. Without it, you wouldn't be able to send e-mail.
- Peter
 
Juan Zhang
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
Jayson Falkner
Author
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic