File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other JSE/JEE APIs and the fly likes Sample Java Mail program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Sample Java Mail program" Watch "Sample Java Mail program" New topic

Sample Java Mail program

An Sush
Ranch Hand

Joined: Jan 17, 2007
Posts: 47
I want to setup a simple java application to send mail using javax.mail api. Please tell me what all is need? like the mail server, the settings etc
Can Websphere Application Server v6.1 be used as a mail server? If not, tell me some free mail servers.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42959
I think all J(2)EE compliant servers include a mail server, but if not, check out Apache James.

The points to much useful material regarding JavaMail, including a lengthy tutorial at that has many code examples.
Janardan Kelkar
Ranch Hand

Joined: May 05, 2008
Posts: 72

I had developed an email client as one of my college projects.We had used that java mail API, and had used the mercury mail server available with XAMPP. It works good enough.

When the compiler's not happy, ain't nobody happy.
Vinoth Thirunavukarasu
Ranch Hand

Joined: Dec 18, 2008
Posts: 164

See this Example. I think this will help you.


Java Best Practices
Linux Best Practices
Amortization Calculator

Carey Evans
Ranch Hand

Joined: May 27, 2008
Posts: 225

Most versions of Windows come with a mail server as part of IIS (not the Windows Home versions), and all Unix versions should have the option to install Exim, Postfix or Sendmail.
I agree. Here's the link:
subject: Sample Java Mail program
jQuery in Action, 3rd edition