如何使用node.js向特定手机号码发送消息?

时间:2013-10-25 07:36:35

标签: node.js express

我是node.js的新手。想要实现一个将文本发送到给定数字的系统。请帮我。谢谢。

1 个答案:

答案 0 :(得分:2)

要从Node.js发送短信,请试试Twilio:http://www.twilio.com/docs/node/install

// Your accountSid and authToken from twilio.com/user/account
var accountSid = 'AC32a3c49700934481addd5ce1659f04d2';
var authToken = "";
var client = require('twilio')(accountSid, authToken);

client.sms.messages.create({
    body: "Jenny please?! I love you <3",
    to: "+14159352345",
    from: "+14158141829"
}, function(err, message) {
    process.stdout.write(message.sid);
});