Sending email in Java using Gmail, Yahoo, Hotmail and so on

In this tutorial, I’ve created simple maven web application to send email using gmail or any other mail. I’ve used JSF for frontend. Make sure you’ve installed glassfish server before beginning. You can download and install glassfish server from this.

When you’re done, you’ll get something like this :

First of all, create a simple maven web application EmailWithJSF. Then in pom.xml include the following dependency. The dependency is required for sending email in java.