In this post under Java Mail, I will explain with example how to search mails in an inbox. To start a search we need to establish criterias and only those mails matching the criterias will be displayed. To establish criteria we will take the help of javax.mail.search.SearchTerm abstract class. Even though SearchTerm is an abstract…… Continue reading Searching Mails
Category: Java Mail
Receiving Email using POP3 protocol
In this post under Java Mail, I will explain with example how to receive email using POP3 protocal. The steps involved are 1) Setup the properties object2) Create a Session object3) Get a Store instance using Session’s getStore method4) Connect to the store using email address and application password5) Get the inbox folder from the…… Continue reading Receiving Email using POP3 protocol
javax.mail.Authenticator Example
In this post under Java Mail, I will explain the use of Authenticator abstract class with an example. Note: For this example and other examples in future we need to have1) Gmail account2) GMail SMTP server address3) Stop the antivirus software running on your local.4) Create an application password. The steps are mentioned in the…… Continue reading javax.mail.Authenticator Example
ConnectionListener Example
In this post under Java Mail, I will explain the use of ConnectionListener interface with an example. Note: For this example and other examples in future we need to have1) Gmail account2) GMail SMTP server address3) Stop the antivirus software running on your local.4) Create an application password. The steps are mentioned in the url…… Continue reading ConnectionListener Example
TransportListener Example
In this post under Java Mail, I will explain with example the purpose and how to use TransportListener interface. Note: For this example and other examples in future we need to have1) Gmail account2) GMail SMTP server address3) Stop the antivirus software running on your local.4) Create an application password. The steps are mentioned in…… Continue reading TransportListener Example
Sending Email Using SMTP (Approach 2)
In this post under Java Mail. I will show with an example how to send email using Java Mail api and SMTP protocol. Note: For this example and other examples in future we need to have 1) Gmail account 2) GMail SMTP server address 3) Stop the antivirus software running on your local. 4) Create…… Continue reading Sending Email Using SMTP (Approach 2)
Sending Email Using SMTP (Approach 1)
In this post under Java Mail. I will show with an example how to send email using Java api and SMTP protocol. Note: For this example and other examples in future we need to have 1) Gmail account 2) GMail SMTP server address 3) Stop the antivirus software running on your local. 4) Create an…… Continue reading Sending Email Using SMTP (Approach 1)