Gmail SMTP Server
Link describing on how to use Email support through Google Workspace.
You can send email to anyone inside or outside your organization using smtp.gmail.com as your SMTP server.
This option requires you to authenticate with your Gmail or Google Workspace account and password when you set it up.
The device uses those credentials every time it attempts to send email.
The sending limit is 2,000 messages per day.
Google App passwords
An app password is a 16-digit passcode that gives a less secure app or device permission to access your Google Account.
App passwords can only be used with accounts that have 2-Step Verification turned on.
Manage your app passwords at: https://myaccount.google.com/apppasswords
After we create app password we’ll be presented with one time 16-digit code we can use as our google account password:
Instructions on what are and how to use app passwords
Gmail SMTP properties
For server address, enter smtp.gmail.com.
For Port, enter one of the following numbers:
-
For SSL, enter 465
-
For TLS, enter 587
For authentication, enter your complete Google email address (for example: your.name@gmail.com) and app password.
Example of application.properties for Gmail SMTP for Spring Boot app:
########################## ## MAIL SETUP FOR GMAIL ## ########################## #--- spring.config.activate.on-profile=gmail spring.mail.username=${GMAIL_USERNAME:yourmail@gmail.com} spring.mail.password=${GMAIL_PASSWORD:yourGmailPassword} spring.mail.host=smtp.gmail.com spring.mail.port=587 spring.mail.properties.mail.transport.protocol=smtp spring.mail.properties.mail.smtp.auth=true spring.mail.properties.mail.smtp.starttls.enable=true spring.mail.properties.mail.smtp.starttls.required=true spring.mail.properties.mail.smtp.ssl.trust=smtp.gmail.com
This setup expects GMAIL_USERNAME and GMAIL_PASSWORD environment variables populated with appropriate values.