Mailgun in Javascript

Mailgun is a great email service with reasonable pricing, including a fantastic free tier.

Once you set up the account, sending email from NodeJS is incredibly easy.

var api_key = 'MY_API_KEY';
var domain = '';
var mailgun = require('mailgun-js')({apiKey: api_key, domain: domain});
var data = {
  from: 'Some User <>',
  to: ',',
  subject: 'Hello',
  text: 'This is a test!',
  html: 'This is a <b>test</b>!'
mailgun.messages().send(data, function (error, body) {

Leave a Reply

Your email address will not be published.