sendSMS

Top  Previous  Next

sendSMS allows text messages ( also known as SMS, or short messages service ) to mobile phones.

Definition

 

twilio.sendSMS( to, from, body, callback )

 

Name

Type

Description

to

string

The mobile phone number to send to.

from

string

A phone number from your phone number list registered with Twilio.

body

string

The message to send. Max 140 characters.

callback

function

The function that will be called once the message was sent ( or not, check the status )

Callback function signature

function ( status, err )

 

Name

Type

Description

status

boolean

status of the SMS send, true if sent succesfully and false if failed. Note that SMS send does not mean it was received yet.

err

string

Error description if any.

 

Example

twilio.sendSMS('8055049741', '8055049741', 'Your house is on fire', function ( status, err )

 print("SMS Send: ", status, err )

end)

This will print

 

SMS Send: true

Related

Twilio

callNumber

phoneNumbers

Availability

Lua

Actions