Hey guys,
I recently made an EA that will give me email alerts and everything works perfectly on this computer but when I try to use it on the other computer it is failing on me for an unknown reason.
The email settings are the same as well as the settings of the EA itself.
I get the "success" and "time" and last_time to print so it's getting that far at least.
It's just not saying that it sent the email nor is it sending it.
When I do the email test I do receive an email and yes the EA has a smiley face in the top right.
Any ideas would be welcome.
Here is the code:
I recently made an EA that will give me email alerts and everything works perfectly on this computer but when I try to use it on the other computer it is failing on me for an unknown reason.
The email settings are the same as well as the settings of the EA itself.
I get the "success" and "time" and last_time to print so it's getting that far at least.
It's just not saying that it sent the email nor is it sending it.
When I do the email test I do receive an email and yes the EA has a smiley face in the top right.
Any ideas would be welcome.
Here is the code:
Inserted Code
//+------------------------------------------------------------------+ //| ALERT.mq4 | //| AntiVi | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "AntiVi" #property link "https://www.mql5.com" #property version "1.00" #property strict extern double Breach = 0.0001; bool AlertsOnTheHour() //true when new H1 bar is formed { static datetime last_time = SeriesInfoInteger(_Symbol,PERIOD_CURRENT,SERIES_LASTBAR_DATE); datetime time = SeriesInfoInteger(_Symbol,PERIOD_CURRENT,SERIES_LASTBAR_DATE); if(last_time != time) { Print("last_time "+last_time); Print("time "+time); last_time = time; Print("Success"); return true; } return false; } //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { if(AlertsOnTheHour()) { if(Close[1] > High[2]) { SendMail("Setup detected.", "EUR-USD Bullish Setup Detected!"); } else if(Close[1] < Low[2]) { SendMail("Setup detected.", "EUR-USD Bearish Setup Detected!"); } } }