Email

当前显示英文原文,切换到「中文」可查看译文。

The E-mail tool in RouterOS enables sending emails directly from the device using SMTP with plain authentication or TLS encryption, supporting scheduled backups and customizable email content. It allows configuration of SMTP servers, authentication details, encryption settings, and attachment handling through the /tool/e-mail submenu.

Email

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.

  1. Configure the SMTP server.
[admin@MikroTik] /tool/e-mail> set server=10.1.1.1 port=25 from="router@mydomain.com"
  1. Add a new script named "export-send":
/export file=export 
/tool/e-mail/send to="config@mydomain.com" subject="$[/system/identity/get name] export" \
body="$[/system/clock/get date] configuration file" file=export.rsc
  1. 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.

  1. 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
  1. Send an email using the send command.
/tool/e-mail/send to=myuser@anotherdomain.com subject="email test" body="email test"