IIRC, the maximum limit on emails, is just like SendNotification: “no more than 2 calls per second and not more than 10 calls per minute.” Add a Sleep(6) (or indicator equivalent) after the Send… and wrap a mutex around both (for multiple charts).
Keeping things simple, I have an MQL4 program that sends a daily report email.
Some days the email will send, other days I get two "Mail: login to smtp.gmail.com:465 failed" in the journal.
On the days it fails, I click the "Test" button in the Email tab under Options and it then sends the email it was supposed to send along with the test email successfully.
@Paul The SMTP is gmail so it shouldn't be an issue, I reckon William found my issue so I'll try that solution.
@William, I think you found my issue. I made a bad practice because I was lazy, of sending the email at an exact time (second resolution) but from multiple pairs so it bunches them up. I don't mind the multiple emails coming into the inbox, and it seemed to work....until it didn't.
I'll mod the code to send from a single pair and add a sleep so it doesn't try to send multiple emails out in that second. Thanks for the help.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Keeping things simple, I have an MQL4 program that sends a daily report email.
Some days the email will send, other days I get two "Mail: login to smtp.gmail.com:465 failed" in the journal.
On the days it fails, I click the "Test" button in the Email tab under Options and it then sends the email it was supposed to send along with the test email successfully.
So my question is why is the email sending intermittently working?