Send simple email using JavaMail API

We are explaining here an example of sending simple email using JavaMail API. Steps of sending simple email using JavaMail API: 1. Get a session instance from getDefaultInstance() or getInstance() method of Session class. 2. Create a message we have to pass session object in MimeMessage class constructor. 3. Use the InternetAddress class to set … Read more

JavaMail API sending email

As we discussed in earlier tutorials that SMTP server is responsible for sending emails so we need SMTP server to send email from our java application. We can get the SMTP server by using any one of the following techniques: Install and use any SMTP server such as Postfix server, Apache James server etc. Use … Read more

JavaMail API core classes

The javax.mail and javax.mail.internet package consist the commonly used core classes for JavaMail API. Commonly used core classes of JavaMail API: javax.mail.Session javax.mail.Message javax.mail.internet.MimeMessage javax.mail.Address javax.mail.internet.InternetAddress javax.mail.Authenticator javax.mail.Transport javax.mail.Store javax.mail.Folder   1. javax.mail.Session: The Session class is the primary class for JavaMail API. The Session object is used to handle configuration setting and authentication and … Read more