static public method terminal:alertEmail

Brief

Sends an e-mail.

Declaration
Lua
terminal:alertEmail (email, subject, text)

Parameters
email

The e-mail address.

subject

The email subject.

text

The email text.

Due to specific of STMP protocol, if the first line of your message is in form "name: value" (for example "instrument: EUR/USD"), add a line break into the beginning of the message. Otherwise, the mail server can recognize the first line of your message as a part of the message header, i.e. in the example above use start the message with "\ninstrument: EUR/USD"

Details

Example [hide]

   function Init()
       ...
       strategy.parameters:addBoolean("SendEmail", "Send email on signal", "", false);
       strategy.parameters:addString("Email", "Email address", "", "");
       strategy.parameters:setFlag("Email", core.FLAG_EMAIL);
       ...
   end
 
   function Update()
       if myCondition then
           if instance.parameters.SendEmail then
               terminal:alertEmail(instance.parameters.Email, mySubject, myEmailMessage);
           end
       end
   end

back