Download MetaTrader 5

Insert time in a email body

To add comments, please log in or register
Any questions regarding MQL5 Cloud Network? FAQ will help you!
ludodoucet
47
ludodoucet 2012.01.22 11:19 

Hello,

I want to insert the current time in a email body or subjet, in a indicator.

 The email have this form:

Subjet: Buy alert

Body: 11h35 Buy alert in H1 

For make a mail no problem: SendMail("Buy alert","Buy alert in H1") 

But you know how to insert the timecurrent() paramètre for had it in the mail?  

Thank you for your answer. 

Documentation on MQL5: Date and Time / TimeCurrent
  • www.mql5.com
Date and Time / TimeCurrent - Documentation on MQL5
Bogdan Alin Baltatu
2924
Bogdan Alin Baltatu 2012.01.22 12:51  

Convert current time to string with TimeToString().

Documentation on MQL5: Conversion Functions / TimeToString
  • www.mql5.com
Conversion Functions / TimeToString - Documentation on MQL5
ludodoucet
47
ludodoucet 2012.01.22 14:44  

I make a string like that:

 string  TimeToString(

   datetime  value,                           // number
   int       mode=TIME_DATE|TIME_MINUTES      // output format
   );

But how to integrate it in SendMail() function.

Thanks.

Documentation on MQL5: Common Functions / SendMail
  • www.mql5.com
Common Functions / SendMail - Documentation on MQL5
Bogdan Alin Baltatu
2924
Bogdan Alin Baltatu 2012.01.22 18:46  
string body="";
body="some text"+TimeToString(TimeCurrent());
SendMail("subject",body);
Something like this. Sorry I post from my phone and i dont see code tag.
ludodoucet
47
ludodoucet 2012.01.22 20:22  
Ok merci, it's working...
To add comments, please log in or register