sms.js 453 B

12345678910111213141516
  1. var client = require('twilio')(process.env.account_sid, process.env.auth_token)
  2. client.sms.messages.create({
  3. to:'+18037123283',
  4. from:'8037124787',
  5. body:'a person wants to chat online'
  6. }, function(error, message) {
  7. if (!error) {
  8. console.log('Success! SID:');
  9. console.log(message.sid);
  10. console.log('Message sent on:');
  11. console.log(message.dateCreated);
  12. } else {
  13. console.log('Error!');
  14. }
  15. });