Java Code to send email using Gmail via TLS?

The following example show you how to send email using Gmail SMTP via TLS connection. The username and password is use to authenticate you against the Gmail.
The configuration / properties used for connection to the Gmail SMTP is defined in the createConfiguration() method. The properties include information such as the SMTP host address, port number, etc.
Let's see the code snippet below:  more...

FURTHER READING

How do I send email using Gmail via SSL? 

In this example you will use the SSL connection to connect to Gmail SMTP server. The difference with is in the properties / configuration that we use to create the mail session object.

No comments:

Post a Comment