SendMail()

View as Markdown

Definition

Sends an email message through the default email sharing service.

Notes:

  1. This method can only be called once the State has reached State.Realtime. Calls to this method in any other State will be silently ignored (in contrast to the implementation for AddOns).
  2. You MUST configure an email account as a default “Mail” Share Service from the General Options.

Method Return Value

This method does not return a value.

Syntax

SendMail(string to, string subject, string text)

If mail is not received, please check the Log tab of the control center for any specific errors which could be related to delivering the message.

Parameters

ParameterDescription
toThe email recipient
subjectSubject line of email
textMessage body of email

Examples

1// Generates an email message
2SendMail("[email protected]", "Trade Alert", "Buy ES");