SendMail()

<< Click to Display Table of Contents >>

Navigation:  NinjaScript > Language Reference > Common > Alert, Debug, Share >

SendMail()

Previous page Return to chapter overview Next page

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)

 

Warning:  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

to

The email recipient

subject

Subject line of email

text

Message body of email

 

 

Examples

ns

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