Skip to main content

Configure a Gmail account as SMTP server to send emails

To use Gmail's SMTP server for sending email, follow the following simple steps.

1. Make sure the 2-Step Verification is turned on for the Gmail account.

Follow this guide to turn on 2-Step Verification.

2. Add an "app password" for your self-hosted Obico server.

  1. Go to the account page for the Gmail account you intend to use.
  2. Select "Security".
  3. Under "Signing in to Google," select "App Passwords".
  4. At the bottom, choose "Select app", and "Other (Custom name)".
  5. Choose a name for this app password, such as "My Obico server".
  6. Click "Generate".
  7. On the next screen, copy the text in the yellow box. This is the pass you will use in the next step.

Site configuration

Site configuration

Site configuration

Site configuration

If you run into issues creating an app password, you can check out Google's guide.

3. Configure .env with the correct email settings.

EMAIL_HOST=smtp.gmail.com
EMAIL_HOST_USER=the_full_email@gmail.com
EMAIL_HOST_PASSWORD=the_app_password_you_copied_from_previous_step
EMAIL_PORT=587
EMAIL_USE_TLS=True
tip

If you can't find the .env file, check out this guide.

4. Restart the server.

docker compose up --build -d

5. Send a test email

Follow this guide to send a test email.