The SendMail function sends a message to the NXT brick's mail box. This message can be read using a normal NXT-G program running on the brick. This allows you to communicate with NXT-G programs from your phone or tablet.
The mailbox parameter is the target mailbox number and can be a value between 1 and 10.
The type parameter should be one of the following values: “Text”, “Number” or “Logic” depending on what type of value you wish to send to the brick's mailbox.
nxt.SendMail( mailbox, type, message );
function OnStart() { nxt = app.CreateNxt(); app.SetMenu( "Connect,SendMail" ); } function OnMenu( name ) { if( name=="Connect" ) nxt.ShowDevices(); else if( name=="SendMail" ) nxt.SendMail( 1, "Text", "Hello" ); }