Deleting emails using JavaMail API

We are explaining here an example of deleting emails using JavaMail API. Steps of deleting email using JavaMail API: 1. Get a session instance from getDefaultInstance() or getInstance() method of Session class. 2. Create the store object (POP3) and connect to the pop store. 3. Create the folder object by calling getFolder() method on store … Read more

Forwarding emails using JavaMail API

We are explaining here an example of forwarding emails using JavaMail API. Steps of forwarding email using JavaMail API: 1. Get a session instance from getDefaultInstance() or getInstance() method of Session class. 2. Create the store object (POP3) and connect to the pop store. 3. Create the folder object by calling getFolder() method on store … Read more

Replying emails using JavaMail API

We are explaining here an example of replying emails using JavaMail API. Steps of replying email using JavaMail API: 1. Get a session instance from getDefaultInstance() or getInstance() method of Session class. 2. Create the store object (POP3) and connect to the pop store. 3. Create the folder object by calling getFolder() method on store … Read more

Reading email attachments in java

We are explaining here an example of receiving or fetching email with attachment using JavaMail API. The Store, Folder, Multipart and BodyPart classes are used to receive an email with attachment using JavaMail API. Steps of reading email attachments in java using JavaMail API: Get the Session object. Create the POP3 store object and connect … Read more

Receiving or fetching simple email using JavaMail API

We are explaining here an example of receiving or fetching simple email using JavaMail API. The Store and Folder classes are used to receive an email using JavaMail API. Steps of receiving or fetching simple email using JavaMail API: 1. Get a session instance from getDefaultInstance() or getInstance() method of Session class. 2. Create the … Read more

Send simple email through Gmail server using SSL connection

We are explaining here an example of sending simple email through gmail server with SSL connection using JavaMail API. Steps of sending simple email through gmail server 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 … Read more

Send simple email through Gmail server using TLS connection

We are explaining here an example of sending simple email through gmail server with TLS connection using JavaMail API. Steps of sending simple email through gmail server 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 … Read more

Send inline image in email using JavaMail API

We are explaining here an example of sending inline image in email using JavaMail API. Difference between inline and attachment in email. Inline can be seen directly in the message body while attachment cannot be seen directly in the message body, we have to click it to open and view the attachment. Steps of sending … Read more

Send HTML content in email using JavaMail API

We are explaining here an example of sending HTML content in email using JavaMail API. Steps of sending HTML content in 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 … Read more

Send email with attachment using JavaMail API

We are explaining here an example of sending email with attachment using JavaMail API. Steps of sending email with attachment 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 … Read more