Mikrotik: Send Email from Script Without Configured Email Client

This guide shows how to send an email from a Mikrotik router script without setting up the email client in the UI.

🎥 Video Tutorial

Steps to Send Email from a Mikrotik Script

1. Connect to Router

  • Use Winbox to connect to your Mikrotik router. Screenshot 1

2. Open the Scripts Section

  • Navigate to: System → Scripts Screenshot 2 Screenshot 3

3. Create a New Script

  • Click on Add New and paste the following script:
:log info "Starting Script...";
:local sysname [/system identity get name];
:local smtpserv [:resolve "smtp.gmail.com"];
:local Eaccount "youremail@gmail.com";
:local pass "YourPassword";
:local Raccount "EmailWhereToSend@gmail.com"
/tool e-mail send from="<$Eaccount>" to=$Raccount server=$smtpserv\ port=587 user=$Eaccount password=$pass start-tls=yes\ 
subject="$sysname"\ body="$sysname Test Message";

Screenshot 4

4. Apply and Run the Script

  • Press Apply
  • Click Run Script Screenshot 5

5. Check for Results

  • Open Logs to see script output.
  • Check the recipient's email inbox for the test message. Screenshot 6

🔒 Note

  • This script uses plain text credentials — avoid using this method in production unless secured.
  • For Gmail, make sure Less secure app access is allowed or use an App Password if 2FA is enabled.