0. Prerequisites

Enable 2-Step Verification for your Google account if you haven't already.

1. Create an app password

Create an App Password:

  • Go to your Google Account settings
  • Select "Security"
  • Under "Signing in to Google," select "App Passwords"
  • Generate a new app password for EMQX-Guard-Pro gmail-app-password

2. Copy Gmail SMTP configuration

> more smtp.conf
smtp {
  enable = true
  auth = if_available  
  from_address = "[email protected]"
  host = "smtp.gmail.com:465"
  password = "The app password you generated"
  skip_verify = true
  to_address = "[email protected] ,[email protected]"
  user = "[email protected]"
}

3. Load the configuration

./bin/emqx ctl guard load ./smtp.conf
loaded smtp ok

4. Test the notification

./bin/emqx ctl guard test

gmail-test-notification

5. Common issues

If you don't receive the test message and find no errors in the EMQX log, verify:

  • user and from_email are full Gmail addresses (@gmail.com)
  • password is the generated app password
  • skip_verify = true
  • host = "smtp.gmail.com:465" (not port 587)

6. Reference