SMTP Mail Through Java with Example

SMTP Mail Through Java with Example

Two mail through java with example are here to show you how to use JavaMail API method to send an email via Gmail SMTP server, using both TLS and SSL connection.

below details are required for sending an email.

To run this example, you need two libraries – javaee.jar and mail.jar

GMail SMTP detail here ….

1. JavaMail –SSL(Through GMAIL)

To send an  Mail Through Java and SMTP server using SSL connection please find below Example .

 

2. JavaMail –TLS(Through GMAIL)

To send an  Mail Through Java and SMTP server using TLS connection please find below Example .

 

 

 

Facebook