Synology: Activate Gmail SMTP For Docker Containers

Synology Activate Gmail SMTP For Docker Containers

Did you know you can easily set up SMTP using your Gmail account? Many Docker containers need SMTP to better work in your environment and Google is coming to your help by giving you an option to activate SMTP. What is SMTP? SMTP, which stands for Simple Mail Transfer Protocol, is an email protocol used for sending email messages from one email account to another. In this step by step guide I will show you how to activate Gmail SMTP to easily integrate it in some docker containers like Vaultwarden, Bitwarden, Joplin, Moodle, Gitea, Lychee, Plausible, ChiefOnboarding, Vikunja etc. that need SMTP to work as expected.

  • STEP 1

Please Support My work by Making a Donation.

  • STEP 2

Access Google Security by clicking the blue link below.

ACCESS GOOGLE SECURITY

  • STEP 3

Click App passwords. Follow the instructions in the image below.

Synology Gmail SMTP Docker 1

  • STEP 4

Under Select app, click on “Other (Custom name)“. Follow the instructions in the image below.

Synology Gmail SMTP Docker 2

  • STEP 5

Give a name to your project, for example “SMTP“, then click GENERATE. Follow the instructions in the image below.

Synology Gmail SMTP Docker 3

  • STEP 6

After you click GENERATE at STEP 5 a new pop up window will open with your own 16 characters secret password. Save this secret password somewhere safe. Click Done. Follow the instructions in the image below.

Synology Gmail SMTP Docker 4

  • STEP 7

Done! You can now use SMTP whenever you need to. Below you can find an example of SMTP settings to add to some Docker containers that require SMTP. In the image below I will show you an example of how to add SMTP values to the Vaultwarden admin dashboard.
Note: The password is your own app password that you have previously generated at STEP 6.
Note: When you type in your app password, remember that there should be no spaces. Google will generate the password with spaces. You should remove all the spaces like in the example below.

Host: smtp.gmail.com
Port: 587
Encryption: TLS
Username: yourname@gmail.com
Password: mpregtwiymludpen

Synology Gmail SMTP Docker 5 new

When you test the email settings, everything will work like a charm!

Synology Gmail SMTP Docker 6

Note: You can use these SMTP settings wherever you need to, not just Docker containers.
Note: Example for SMTP settings with WordPress.

This post was updated on Thursday / January 19th, 2023 at 11:42 PM