Email function works from desktop, but doesn't work from VPS.

 

I have read many threads on this, on this forum and outside of it, but haven't managed to solve it so far.

I have an EA that sends an email on a new bar. The email function in Options works fine from my desktop.

The emailing function in the EA works perfectly from my desktop.

Applying exactly the same settings to the email function (and EA) on MT4 from the VPS results in an immediate error

Mail: login to smtp.gmail.com failed

I have added terminal.exe to the firewall exceptions.

Any ideas what I am missing?

 
Is it MQL5 VPS for MT4/M5?
Because if this email funbction is using dll in any way so it will not work with this VPS.
 

Best is use notification. I have tried the same thing before, but it also din't work in my case.

If you do not want to give up, the VPS is hosted in a different location which you need to authorise in Gmail.

Another thing is you may also need to use an App Password.

Access Gmail in a Desktop Client Even If You've Set Up 2-Factor Authentication
Access Gmail in a Desktop Client Even If You've Set Up 2-Factor Authentication
  • www.lifewire.com
Two-factor authentication on your Google account requires a special code—either through a text message or through a mobile app—to accompany your username and password. However, programs like desktop email clients (think Microsoft Outlook or Mozilla Thunderbird or Evolution) cannot send a two-factor challenge response. The solution? An...
 
It is Windows 12 Server for VPS trading, running MT4 or MT5.
 
Thank you Mr Zhou for your suggestions.
 
The publisher is working fine through ftp. It does not even seem to try to login to gmail - straight away says login failed.
 

This fixed the problem. Logging into the gmail account from the server desktop and approving the security then allowed MT4 to work it's magic.

Thanks for the quick solutions - add me as a friend.

[SOLVED]

 
samuk1000:

This fixed the problem. Logging into the gmail account from the server desktop and approving the security then allowed MT4 to work it's magic.

Thanks for the quick solutions - add me as a friend.

[SOLVED]

Hi Samuk,

Can you please explain what you did.. I am having the same problem. thanks 

 
samuk1000:

This fixed the problem. Logging into the gmail account from the server desktop and approving the security then allowed MT4 to work it's magic.

Thanks for the quick solutions - add me as a friend.

[SOLVED]

Thanks. This worked for me too. Thanks.
Reason: