Home: www.vipan.com Vipan Singla e-mail: vipan@vipan.com
E-Mailing Through Java

JavaMail

  • You can send or fetch e-mail through your Java application or servlet using the JavaMail API.
  • You use the JavaMail API where as JavaMail implementation providers implement the JavaMail API to give you a JavaMail client (Java JAR file). Sun gives you mail.jar which has Sun's SMTP, POP3 and IMAP client implementations along with the JavaMail API. This is sufficient to send and receive e-mail but not to read or post to newgroups which use NNTP.

Sample Code to Send E-Mail

Sample Code to Send Multipart E-Mail, HTML E-Mail and File Attachments

Sample Code to Fetch E-Mail

Useful Classes and Interfaces

Steps to Use JavaMail

Utility Classes

Message Flags

JavaMail Events

More on JavaMail's Internal Workings

How E-Mail Works


© Vipan Singla 2001