Socket
Socket
Sign inDemoInstall

mailgun.js

Package Overview
Dependencies
Maintainers
4
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mailgun.js

A javascript sdk for Mailgun built with webpack, babel & es6. This can be used in node or in the browser*.


Version published
Weekly downloads
303K
decreased by-3.22%
Maintainers
4
Weekly downloads
 
Created

What is mailgun.js?

The mailgun.js npm package is a client library for interacting with the Mailgun API, which is a service for sending, receiving, and tracking emails. This package allows developers to easily integrate Mailgun's email functionalities into their Node.js applications.

What are mailgun.js's main functionalities?

Send Email

This feature allows you to send an email using the Mailgun API. You need to provide the sender's email, recipient's email, subject, and body of the email.

const mailgun = require('mailgun.js');
const formData = require('form-data');
const mg = mailgun.client({username: 'api', key: 'YOUR_API_KEY', url: 'https://api.mailgun.net'});

const data = {
  from: 'Excited User <mailgun@sandbox-123.mailgun.org>',
  to: 'bar@example.com, YOU@YOUR_DOMAIN_NAME',
  subject: 'Hello',
  text: 'Testing some Mailgun awesomeness!'
};

mg.messages.create('YOUR_DOMAIN_NAME', data)
  .then(msg => console.log(msg))
  .catch(err => console.error(err));

Validate Email Address

This feature allows you to validate an email address to check if it is in the correct format and exists.

const mailgun = require('mailgun.js');
const mg = mailgun.client({username: 'api', key: 'YOUR_API_KEY', url: 'https://api.mailgun.net'});

mg.validate.get('test@example.com')
  .then(validation => console.log(validation))
  .catch(err => console.error(err));

List Management

This feature allows you to create and manage mailing lists. You can create a new list by providing the list address and name.

const mailgun = require('mailgun.js');
const mg = mailgun.client({username: 'api', key: 'YOUR_API_KEY', url: 'https://api.mailgun.net'});

mg.lists.create('list@sandbox-123.mailgun.org', {name: 'My List'})
  .then(list => console.log(list))
  .catch(err => console.error(err));

Other packages similar to mailgun.js

Keywords

FAQs

Package last updated on 24 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc