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