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

Warning: In order to be able to see the “App Password” section, it’s mandatory to activate 2FA authentication on your Gmail account. If the 2FA authentication is OFF, you cannot set up an App Password.

  • STEP 4

Click 2-Step Verification. Follow the instructions in the image below.

Synology Activate GMAIL App Password 1

  • STEP 5

Scroll down the page until you find App passwords. Click App passwords. Follow the instructions in the image below.

Synology Activate GMAIL App Password 2

  • STEP 6

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

Synology Gmail SMTP Docker 2

  • STEP 7

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 8

After you click GENERATE at STEP 7 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 9

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: Some Docker Containers, like Calcom, use SSL Port 465 instead of STARTTLS port 587.
Note: Example for SMTP settings with WordPress.
Note: Example for SMTP settings with Nextcloud.
Note: Example for SMTP settings with Uptime Kuma.
Note: Example for SMTP settings with Mautic.
Note: Example for SMTP settings with ProjectSend.
Note: Example for SMTP settings with Moodle.
Note: Example for SMTP settings with Mattermost.
Note: Example for SMTP settings with Joomla.
Note: Example for SMTP settings with Dolibarr.
Note: Example for SMTP settings with OpenProject.
Note: Example for SMTP settings with PrestaShop.
Note: Example for SMTP settings with SolidInvoice.
Note: Example for SMTP settings with Pi.Alert.
Note: Example for SMTP settings with Seafile.
Note: Example for SMTP settings with Flarum.
Note: Example for SMTP settings with Pydio Cells.

This post was updated on Monday / May 22nd, 2023 at 12:36 AM