Java - Send Email Securely via the Gmail API

7

I'm using a API mail%% of this tutorial for sending email via Mail.jar , however I realized that I have to, enable permission for less secure applications. Is there another way to send email Java , without having to enable this less secure Gmail option?

    
asked by anonymous 03.11.2016 / 22:22

1 answer

1

There are 3 ways to send an email through Gmail:

  • Enable this option for less secure applications, although it can not be used if the account has TFA enabled.
  • Use application password , although the user must create one to send the email.
  • Use the Google API for Java that opens a web page where you can sign in account is even having TFA (recommended) .

It's important to know that the Google example comes with issues to view the tags. To change this, simply go to the SCOPES list and change GmailScopes.GMAIL_LABELS to GmailScopes.GMAIL_COMPOSE .

    
01.12.2016 / 12:39