Technical Tip: How to configure email alerts with Gmail
Description
Solution
This is an example of the configuration in FortiGate:
Configure the Gmail account in the FortiGate.
set server "smtp.gmail.com"
set port 587
set authenticate enable
set username "test"
set password SGKSDHFK
set security starttls
end
Configure the destination of the email alert.
config alertemail setting
set username "test@gmail.com"
set mailto1 "test@fortinet.com"
end
Configure the Gmail account to use an App Password:
An App Password is a 16-digit passcode that gives a less secure app or device permission to access the Google Account.
App Passwords can only be used with accounts that have multi-factor authentication turned on: Turn on 2-Step Verification.

Give a name for the app-specific.

Copy the password and paste it into the email server password.
config system email-server
set server "smtp.gmail.com"
set port 587
set authenticate enable
set username "test"
set password SGKSDHFK <-------
set security starttls
end
Troubleshooting:
- If authentication fails, regenerate the App Password and re-enter it in the FortiGate configuration.
- If the CLI returns a syntax error when entering the password, place the password in quotes/brackets as noted in this article.
- If the test command fails, verify Internet reachability, DNS, and whether the correct outgoing interface is being used.
Technical Tip: How to configure email alerts with Gmail
Note:
For more information on how to set up an App Password on the Google account, refer to the document below:
Following this, it will be possible to send alert emails.
Test this with the following command:
diagnose log alertmail test
Starting from v7.4.4, the default email server has been switched from notification.fortinet.net to fortinet-notifications.com. This default server is only available to registered devices with an active FortiCare support contract. The reply-to field in the source email is automatically updated to DoNotReply@fortinet-notifications.com for all servers, including custom ones.
Related article:
