Skip to content

Instantly share code, notes, and snippets.

@lrvick
Created December 8, 2014 22:29
Show Gist options
  • Save lrvick/ba303eae8ad89b7f0f4d to your computer and use it in GitHub Desktop.
Save lrvick/ba303eae8ad89b7f0f4d to your computer and use it in GitHub Desktop.
Twilio Node.JS SMS sending example.
var twilioNumber = '+19252414543';
var twilioSID = 'Your twilio account SID';
var twilioToken = 'Your twilio auth tokenn'
var client = require('twilio')(twilioSID,twilioToken);
var sendSMS = function(number,message){
client.sms.messages.post({
to:twilioNumber,
from:fromNumber,
body:message
}, function(err, text) {
console.log('Sent: '+ text.body);
console.log('Status: '+ text.status);
});
};
sendSMS('+14072837596','Sample message from node.js'):
@arpitbhatt027
Copy link

not working, have you tested?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment