Created on
07-13-2021
06:19 AM
Edited on
03-18-2025
07:38 AM
By
Jean-Philippe_P
Description
This article describes how to configure email alerts because sometimes the FortiGate cannot access the account in order to send the email alert.
Debug shows:
2021-07-09 11:27:13 resolve smtp.office365.com to 1 IP
2021-07-09 11:27:13 <----- Send mail.
2021-07-09 11:27:13 connecting to 40.101.137.82 port 587
2021-07-09 11:27:13 session: 0x18488f20, rsp_state: greeting, code: 220
2021-07-09 11:27:13 session: 0x18488f20, rsp_state: ehlo, code: 250
2021-07-09 11:27:13 session: 0x18488f20, rsp_state: starttls, code: 220
2021-07-09 11:27:13 rsp_starttls: creating ssl structure for session 0x18488f20
2021-07-09 11:27:13 create_ssl: 0x1852fac0
2021-07-09 11:27:13 sessionn 0x18488f20, SSL connected
2021-07-09 11:27:13 session: 0x18488f20, rsp_state: ehlo, code: 250
2021-07-09 11:27:13 session: 0x18488f20, rsp_state: auth, code: 334
2021-07-09 11:27:13 session: 0x18488f20, rsp_state: auth2, code: 235
2021-07-09 11:27:13 session: 0x18488f20, rsp_state: mail, code: 250
2021-07-09 11:27:13 session: 0x18488f20, rsp_state: rcpt, code: 250
2021-07-09 11:27:13 session: 0x18488f20, rsp_state: data, code: 354
2021-07-09 11:27:13 === send: FGT[FGT80Fxxxxxxxx] Automation Stitch:Admin Fail is triggered. 2021-07-09 11:27:38 _session_on_destroy
2021-07-09 11:27:38 <----- Send mail failed, m = 0x18502ff0 s = 0x18557ac0.
Scope
FortiGate.
Solution
Go to System -> Settings -> Email Service.
SMTP SERVER: smtp.office365.com
PORT: 587
AUTHENTICATION: example@domain.it
Password: xxxxxxxxx
SECURITY MODE: STARTTLS.
Default Reply To: Email sender address
To configure a custom email service in the CLI.
config system email-server
set type custom
set reply-to "helpdesk@fortinet.com"
set server "smtp.office365.com"
set port 587
set source-ip 0.0.0.0 <----- This is an important field to set (source IP which is used to send out the email traffic).
set source-ip6 ::
set authenticate enable
set validate-server disable
set username "example@domain.it"
set security starttls
set ssl-min-proto-version default
end
Select 'OK'.
Related articles:
Technical Tip: Use FortiGate automation stitches for alert emails
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.