How to setup email SMTP Guidelines – Other – 18 October 2024
I saw some questions in forum ask for guidelines to setup email smtp with MQL5. It looks like many people has problem with this feature but there is no clearly solution or guidelines. My Advanced Trading Toolkit also has a feature that provides alerts via email so I decided to write this blog post to guide anyone needs help.
Where to setup Email SMTP in MQL5
On MetaTrader5 application, go to top menu bar and select Tools\Options\Email
Here is how it looks like
How to setup Email SMTP using Gmail
Gmail is popular and many people wants to use it as a SMTP provider to send emails. So I’ll guide you how to fill email setup with Gmail SMTP.
Please fill above fields with these values:
- SMTP server: smtp.gmail.com:587 (Use this value without change. Please note that there is a :587 at the end as the server port)
- SMTP login: your_abc@gmail.com (Replace this with your Gmail address)
- SMTP password: abcd1234 (Replace this with password for above Gmail)
- From: your_abc@gmail.com (Use same email as above. This is the email sender)
- To: your_xyz@gmail.com (Email that you want to receive notification here. This can be the same email as above or not. This doesn’t need to be a Gmail)
Sure! You need to check “Enable email notifications” option on top if you want to receive notifications.
When you have done the setup as above, click “Test” button to send a test email. And… you got an error in the Journal window that says something like this:
Many people gets stuck here and some people claimed that MetaTrader has a problem with this feature.
No! It’s not because of MetaTrader, it’s because of Gmail setup. You need to do these additional actions to able to receive email:
Click “Test” button again and you will see the email sends successfully as below. You’ll also receive an email in your mailbox.
Cool! It works now. However, please keep in mind that Google provides feature to send emails via SMTP but it’s not a real SMTP provider. If you send too much emails, it may block your emails. You may need a real SMTP provider with paid plan if you want to send/receive much of emails. This out of scope of this post and requires some advanced technical knowledges so I’ll not guide you in this post.
Thank you for reading and hope this post is helpful!