How do i programe MT4 to email me

 

I would like MT4 to email me when it makes an order. Then when it closes it show in the email the profit/loss and the balance.

How do i add that to my EA?

 

1. Configure the Email tab (Tools|Options|Email) in the MT4 platform with the SMTP server connection settings (as you would in any eMail client such as Outlook)

- if you need to change the server port number, just use the format <ipaddress>:<port>

- ensure the "Enable" checkbox is ticked

- ensure that the "From" address is appropriate to your authenticated identity, if your SMTP provider requires this

- click the "Test" button, check any error codes in the Journal

- if the Journal tells you the email has been sent, check whatever account you've sent it to


2. Implement the SendMail(string subject, string body) function in your EA

- I extensively use the StringConcatenate() function call within EA functions in order to gradually build "sMessageBody" within various conditional statements before finally issuing the SendMail() function call.


CB

 

I use the attached indicator to send emails to me every hour, and it could easily be included in an EA and modified to send on trade events. It summarises account status and open, pending and closed orders. The output is intended to be viewed as fixed font, eg Courier New

Paul

http://paulsfxrandomwalk.blogspot.com/

Files:
emailstatus.mq4  10 kb
Reason: