The e-mail tool is a built-in RouterOS utility that enables the router to send email messages directly from the device. It can be used to automate delivery of configuration backups and exports to a network administrator on a scheduled basis.
The e-mail tool supports plain authentication and TLS encryption. No other authentication or encryption methods are supported.
Configuration
The SMTP server is configured in the /tool/e-mail menu.
All server settings can be overridden by parameters of the send command.
Sending email
Emails are sent using the /tool/e-mail/send command. Any parameters not specified in the send command inherit their values from the server configuration.
Basic examples
Send a configuration export every 24 hours.
- Configure the SMTP server.
[admin@MikroTik] /tool/e-mail> set server=10.1.1.1 port=25 from="router@mydomain.com"
- Add a new script named "export-send":
/export file=
/tool/e-mail/send to="config@mydomain.com" subject="$[/system/identity/get name] export" \
body="$[/system/clock/get date] configuration file" file=.rsc
- Add a scheduler to run the script.
/system/scheduler/add on-event="export-send" start-time=00:00:00 interval=24h
Send email to a server using TLS encryption.
Google Mail does not allow third-party devices to authenticate using a standard Gmail password. An App password must be generated and used instead.
To generate an App password, navigate to Security > How you sign in to Google, enable 2-Step Verification, then generate an App password. Use the generated value in the set password=mypassword setting shown below.
- Configure the client.
/tool/e-mail
set address=smtp.gmail.com
set port=587
set tls=yes
set from=myuser@gmail.com
set user=myuser
set password=mypassword
- Send an email using the send command.
/tool/e-mail/send to=myuser@anotherdomain.com subject="email test" body="email test"