Sending SMS using NEXMO API in Node.js Last Updated : 14 Feb, 2020 Comments Improve Suggest changes Like Article Like Report Introduction: SMS is a common method of sending short messages between cell phones, but these SMS can be sent using API in Node.js. Now there are lots of API in the market for sending SMS like Twilio, Exotel, etc to the user but the popular among them is Nexmo. Features of NEXMO: Integrating this module in your code is very simple and efficient. Using Nexmo module users can send SMS and also use Nexmo voice APIs for sending voice calls. Introduction: It's easy to get started and easy to use. It is widely used and popular module for sending SMS. User can send SMS to desired mobile number fastly and efficiently. Installation of Nexmo module: You can visit the link to Install nexmo module. You can install this package by using the following command. npm install nexmo After installing nexmo you can check your nexmo version in command prompt using the command. npm version nexmo After that, you can create a folder and add a file. For example index.js. To run this file you need to run the following command. node index.js Requiring module: You need to include nexmo module in your file by using these lines. const Nexmo = require('nexmo'); Filename: index.js javascript // Include nexmo module const Nexmo = require('nexmo'); const nexmo = new Nexmo({ apiKey: 'YOUR_API_KEY', apiSecret: 'YOUR_API_SECRET_KEY', }); // Initialize with sender and reciever // mobile number with text message const from = 'sender_name'; const to = 'reciever_number'; const text = 'Greetings from Geeksforgeeks'; nexmo.message.sendSms(from, to, text, function(error, result) { // If some error occured if(error) { console.log("ERROR", error) } // If message is sent successfully else { console.log("RESULT", result) } }); Steps to run the program: The project structure will look like this: Make sure you have installed nexmo using following commands: npm install nexmo Run index.js file using below command: node index.js If error occurs, then following message will be displayed: Comment More infoAdvertise with us Next Article Sending SMS using NEXMO API in Node.js gouravhammad Follow Improve Article Tags : Technical Scripter Web Technologies Node.js Technical Scripter 2019 Node.js-Misc +1 More Similar Reads Sending bulk emails in Node.js using SendGrid API What is SendGrid API? SendGrid is a platform for sending transactional and marketing emails to the customers. It provides scalability, reliability, and deliverability which is an important issue for an organization.Benefits of using SendGrid API: If you are using Nodemailer with Gmail then you can s 2 min read How to Send Email using Mailgun API in Node.js ? Sending an email is an essential part of any project and it can be achieved by using Mailgun API. It is very popular for sending emails. Features of Mailgun: . It is easy to get started and easy to use.It is a widely used and popular module for sending emails.Mails can also be scheduled. Installati 2 min read How to Send Email using NodeJS? Sending emails programmatically is a common requirement in many applications, especially for user notifications, order confirmations, password resets, and newsletters. In this article, we will learn how to build a simple email-sending system using NodeJS. We will use Nodemailer, a popular module for 5 min read Task Management System using Node and Express.js Task Management System is one of the most important tools when you want to organize your tasks. NodeJS and ExpressJS are used in this article to create a REST API for performing all CRUD operations on task. It has two models User and Task. ReactJS and Tailwind CSS are used to create a frontend inter 15+ min read How to Send JSON Response using Node.js ? NodeJS is the runtime environment, which can execute the javascript code on any platform. It is widely used to create and run web application servers because of its salient features.During production, several times we need to send the resources or some type of information as a response, and javascri 5 min read How to send Attachments and Email using nodemailer in Node.js ? For this purpose, we will use a package called nodemailer. It is a module that makes email sending pretty easy. For using it, you will need to install by using the following command: $ npm install nodemailer Features of nodemailer module: It has zero dependencies and heavy security.You can use it 2 min read Working with forms using Express.js in Node.js In this article, we will be working with forms using ExpressJS in NodeJS.Using server side programming in Node.js, we can create forms where we can put certain parameters which upon filling gets stored in the database.Setting up environment:You can refer to this website for downloading Node.js. Alon 3 min read Real-time Notification System using Next.js and Socket.io This article explains the process of creating a Real Time Notification System using Next.js and socket.io. In a typical scenario, imagine the need to create a user-friendly application. This application helps the user to send and receive notifications and can be used in multiple projects like E-comm 5 min read How to Post Data in MongoDB Using NodeJS? In this tutorial, we will go through the process of creating a simple Node.js application that allows us to post data to a MongoDB database. Here we will use Express.js for the server framework and Mongoose for interacting with MongoDB. And also we use the Ejs for our front end to render the simple 5 min read Node.js socket.send() Method The socket.send() method is an inbuilt application programming interface of class Socket within dgram module which is used to send the message from one socket to another. Syntax: socket.send(msg[, offset, length][, port][, address][, callback]) Parameters: This method takes the following parameter: 3 min read Like