如何向node.js中的移动号码发送验证码? (像nodemailer,但是对于SMS) [英] How can I send verfication codes to mobile numbers in node.js? (Like nodemailer, but for SMS)

查看:111
本文介绍了如何向node.js中的移动号码发送验证码? (像nodemailer,但是对于SMS)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已通过 nodemailer 为我的项目向用户发送了确认电子邮件。它工作正常。

I have sent confirmation e-mails to users by using nodemailer for my project. It is working fine.

现在我希望从node.js向移动号码发送验证码,但我不知道该怎么做。

Now I am looking to send verification codes to mobile numbers from node.js, but I don’t know how to do that.

是否有任何模块可以向手机号码发送验证码,例如nodemailer是否使用电子邮件地址?或者如果没有,我怎么能自己做?

Is there any module to send verification codes to mobile numbers, like nodemailer does with e-mail addresses? Or if not, how can I do this myself?

我使用node.js和mongodb,JavaScript和jQuery开发我的项目。

I developing my project using node.js and mongodb, JavaScript and jQuery.

推荐答案

NodeJS包 https://www.npmjs .com / package / springedge 将很容易发送短信。你可以安装为

NodeJS package https://www.npmjs.com/package/springedge will be easy to send sms. You can install as

npm install springedge

发送短信的代码示例:

// send sms 

var springedge = require('springedge');

var params = {
  'apikey': '', // API Key 
  'sender': 'SEDEMO', // Sender Name 
  'to': [
    '919019xxxxxxxx'  //Moblie Number 
  ],
  'message': 'test+message'
};

springedge.messages.send(params, 5000, function (err, response) {
  if (err) {
    return console.log(err);
  }
  console.log(response);
});

这篇关于如何向node.js中的移动号码发送验证码? (像nodemailer,但是对于SMS)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆