NinjaScript > Language Reference > Alert & Debug >

SendMail()

Print this Topic Previous pageReturn to chapter overviewNext page

Definition

Sends an email message.

 

Syntax

SendMail(string from, string to, string subject, string text)

 

* Calls to this method are ignored on historical data, it will only work in real-time.

 

Parameters

from

From email address

to

To email address

subjecet

Subject line of email

text

Message body of email

 

 

Examples

// Generates an email message

SendMail("support@ninjatrader.com", "customer@winners.com", "Trade Alert", "Buy ES");

 

 

Tips

1.If mails are not sent, check the Control Center Log tab for any error information. You can try changing the SMTP outgoing mail server to use your own ISP's mail server. You can set this information via the Control Center window Tools > Options > Misc.