Use this function to open the Message app passing across the phone number and message

function sendsms(msg, number) {
   app.SendIntent(null, null, "android.intent.action.SENDTO", null,
      'smsto:' + number, null, JSON.stringify([{
         name: "sms_body",
         type: "string",
         value: msg
      }]));
}