Why Bother With MT5’s Native Notifications?
You’ve got an Expert Advisor running on a VPS in some data center. It opens a trade at 2 AM while you’re asleep. Without a notification, you won’t know until morning — and by then, the move might have reversed. MT5’s built-in email and push notification system solves this. It’s free, requires zero MQL coding, and works with any broker that uses the standard MetaTrader 5 build.
This guide covers the exact steps to configure email alerts (via SMTP) and push notifications to your phone using the MetaQuotes ID system. I’ll also show you how to test them, what to do when they fail, and a few tricks most traders miss.
You don’t need to write a single line of MQL5 code. Everything happens inside Tools → Options and the MT5 mobile app. If you’ve already attached an EA or indicator that uses SendNotification() or SendMail(), these settings are what make those functions actually work.
What You’ll Need Before Starting
Let’s get the prerequisites straight so you don’t hit a wall halfway through:
- MetaTrader 5 build 2000 or newer — most brokers auto-update, but check via Help → About. Older builds may lack the push notification fields. I’ve seen build 1995 on some brokers — those won’t have the Notifications tab at all.
- A live or demo trading account — alerts work on both, but some brokers lock email settings on demo accounts. If you can’t save the SMTP config, try switching to a live account temporarily. IC Markets and FXTM are known to restrict email on demo, for example.
- A mobile device with the MetaTrader 5 app installed — for push notifications, you need the app on iOS or Android. The app generates your unique MetaQuotes ID. Version 5.2.0 or later is fine.
- An SMTP email account — Gmail works, but you’ll need an App Password (not your regular password). Yahoo, Outlook, and most custom domains also work if they support SMTP on ports 25, 465, or 587. I’ve had reliable luck with Gmail and Outlook.com; Yahoo sometimes flakes out after a few days.
- VPS or always-on PC — notifications only fire when MT5 is running. If you close the terminal, no alerts go out. For 24/7 coverage, use a VPS. Cheap ones from Contabo or Hetzner work fine for a single terminal.
One thing that trips people up: the email settings in MT5 are for outgoing mail only. You don’t need to configure incoming (POP/IMAP). The terminal just sends messages through your SMTP server. It does not receive replies.
Step 1: Get Your MetaQuotes ID (Push Notifications)
The push notification system uses a device-specific ID rather than your phone number or email. This keeps it simple and secure.
- Open the MetaTrader 5 app on your phone or tablet.
- Log in to the same trading account you use on desktop (or any account — the ID is device-wide).
- Tap the three-line menu (top-left corner), then go to Settings.
- Scroll down to the MetaQuotes ID section. You’ll see a string of letters and numbers, something like
a1b2c3d4-e5f6-7890-abcd-ef1234567890. - Copy that ID exactly — case-sensitive, dashes included. Paste it into a temporary text file on your desktop.
If the field is blank, you’re probably offline or the app can’t reach the MetaQuotes server. Switch to Wi-Fi or cellular data and restart the app. The ID should populate within 30 seconds. On rare occasions, the app needs a fresh login to generate the ID — log out and log back in if it stays blank.
Can you have multiple devices with the same ID? No — each device gets its own unique ID. If you want alerts on both phone and tablet, you’ll need to add both IDs later (more on that in the tips section).
Step 2: Configure Email (SMTP) Settings in MT5
Now for the desktop side. Open MT5 on your PC or VPS.
- Go to Tools → Options (or press Ctrl+O).
- Click the Email tab.
You’ll see a form with these fields. Take your time — a single typo in the server address will fail silently:
| Field | Example Value | Notes |
|---|---|---|
| SMTP Server | smtp.gmail.com | Use your email provider’s SMTP address. Gmail, Outlook, Yahoo all have published ones. For custom domains, check with your hosting provider. |
| SMTP Port | 587 | Common ports: 25 (unencrypted, often blocked), 465 (SSL), 587 (TLS). MT5 works best with 587 for TLS. I’ve had issues with port 25 on most VPS providers. |
| Security | TLS | Options are NONE, TLS, SSL. TLS is the most widely compatible today. If your provider uses SSL, switch to port 465 and select SSL. |
| Login | [email protected] | Your full email address. Some providers accept just the username part, but I always use the full address. |
| Password | App password (16 chars) | Not your regular password! Generate an app-specific password from your email account settings. More on this below. |
| From | [email protected] | Usually the same as the login. Some providers require this to match the authenticated user. |
| To | [email protected] | Where alerts are sent. Can be the same or a different address. I send to a separate email to keep trading alerts out of my main inbox. |
Getting a Gmail App Password (most common case):
- Go to your Google Account → Security → Signing in to Google → App passwords.
- If you don’t see that option, enable 2-Step Verification first (required). This is non-negotiable with Google now.
- Select “Mail” as the app and “Other (Custom name)” as the device — name it “MetaTrader 5”.
- Google generates a 16-character password like
abcd efgh ijkl mnop. Copy it exactly, including spaces. Paste it into the MT5 Password field.
Once filled, click Test. MT5 sends a test email to the address in the “To” field. Check your inbox (and spam folder). If it arrives, you’re set. If not, see the troubleshooting section below.
Step 3: Configure Push Notifications in MT5
- Still in Tools → Options, click the Notifications tab.
- Check the Enable Push Notifications checkbox.
- In the MetaQuotes ID field, paste the ID you copied from your phone app earlier. No spaces before or after.
- Leave the State field as-is (it’s for future use — currently does nothing in any build I’ve tested).
- Click OK to save.
That’s it for the basic setup. Now test it:
- Go back to Tools → Options → Notifications tab.
- Click Test. Your phone should buzz within a few seconds with a message like “Test notification from MetaTrader 5”.
If nothing arrives, check that your phone has internet access and that the MetaTrader 5 app is open (it doesn’t need to be in the foreground, but it must not be force-closed). On iOS, ensure notifications are enabled in Settings → MetaTrader 5 → Notifications → Allow Notifications. On Android, check that the app isn’t being battery-optimized — that’s a common killer of push notifications.
Step 4: Make Your EA or Indicator Use These Settings
Now that email and push are configured, any EA or indicator that calls SendNotification() or SendMail() will use these settings automatically. You don’t need to pass any credentials in the code — the terminal handles that.
For example, a simple EA snippet that sends a push on every new bar:
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
static datetime lastBar = 0;
if(Time[0] != lastBar)
{
lastBar = Time[0];
SendNotification("New bar opened on " + Symbol() + " at " + TimeToString(TimeCurrent()));
}
}Once compiled and attached to a chart, this fires a push notification to your phone every minute (or your chart’s timeframe). The same works for email if you use SendMail("Subject", "Body text") instead.
You can also trigger alerts from custom indicators using Alert() or PlaySound(), but those are terminal-only — they don’t reach your phone. For remote alerts, you must use SendNotification() or SendMail(). A common mistake is calling Alert() in an EA and wondering why your phone stays silent — that function only shows a popup on the desktop terminal.
Rate-Limiting Your Notifications in Code
If your EA triggers on every tick, you’ll flood your phone or hit email limits. Here’s a simple rate-limiter pattern:
//+------------------------------------------------------------------+
//| Expert tick function with rate limiting |
//+------------------------------------------------------------------+
void OnTick()
{
static datetime lastAlert = 0;
if(TimeCurrent() - lastAlert > 60) // Only send once per minute
{
if(SomeCondition) // Your trade logic here
{
lastAlert = TimeCurrent();
SendNotification("Trade signal: Buy " + Symbol());
}
}
}Adjust the interval (60 seconds in this example) to match your strategy’s frequency. For scalping EAs, I use 30 seconds; for swing trading, 5 minutes is fine.
Tips and Best Practices From Experience
Multiple Devices, One Terminal
You can only enter one MetaQuotes ID in the Notifications tab. If you have two phones (or a phone and a tablet), you have two options:
- Option A: Create a second MT5 install (portable version) on the same VPS with the second ID. Run both terminals. Each instance needs its own data folder — use the
/portablecommand-line switch. - Option B: Use email instead of push for the second device. Most email providers let you forward to multiple addresses, or you can set up a free forwarding service like IFTTT.
I prefer Option A because push notifications are more reliable and arrive faster






