To send and retrieve mails, you need a mail (SMTP) server.
To interact with a mail server using Java, you use the JavaMail API.
JavaMail is not a mail server and it look like that you thought that it was somehow.
At least, JavaMail itself already provides an excellent FAQ:
http://java.sun.com/products/javamail/FAQ.html
If you don't want to install and run a mailserver at your own PC using for example Apache James (or others), then you can also use the mailserver of for example your own ISP, or your company or webbased others like Gmail. But you need to consult their documentation or support team to get the connection details, such as the SMTP host name, port number and so on which you can use in your JavaMail configuration settings.
Edit: I see in your topic history that you are less or more familiar with JSP/Servlet.
You can compare JSP/Servlet API less or more with JavaMail API.
With JSP/Servlet (and HTML) you can use HTTP to transfer data between client (webbrowser) and server (
Tomcat or so).
With JavaMail you can use SMTP to transfer data between client (mailprogram) and server (James or so).
Do you got it now?