O'Reilly logo

Lift Application Development Cookbook by Gilberto T. Garcia Jr.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Sending e-mails using Gmail's SMTP server

It does not matter if you are building your company website, an application that will be used only inside the company you work at, or an e-commerce solution. Eventually, you will need to send e-mails. It is fair to say that every web application has the need, at some point, to send e-mails.

In this recipe, we will learn how to send plain text e-mails using Gmail's SMTP server.

Getting ready

You can use the code of the examples we have used in the previous recipe, or you can start a new project.

How to do it...

Carry out the following steps:

  1. You will need to add the following properties into src/main/resources/default.props:
    mail.user=your_email@gmail.com
    mail.password=your_password
  2. Change the mail.user and mail.password ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required