Giter Club home page Giter Club logo

nodemailer-mailgun-transport's Introduction

nodemailer-mailgun-transport

Known Vulnerabilities

What is this?

nodemailer is an amazing node module to send emails within any of your nodejs apps. This is the transport plugin that goes with nodemailer to send email using Mailgun's awesomeness! Pow Pow.

How does it work?

Based on this mailgun-js module and the nodemailer module, the Mailgun Transport was born. This is a transport layer, meaning it will allow you to send emails using nodemailer, using the Mailgun API instead of the SMTP protocol!

Nodemailer allows you to write code once and then swap out the transport so you can use different accounts on different providers. On top of that it's a super solid way of sending emails quickly on your node app(s).

The Mailgun transport for nodemailer is great to use when SMTP is blocked on your server or you just prefer the reliability of the web api!

Support the project

I know this is a tiny module but many people use it in production (high5 to all of us) - if you happen to use this module please click the star button - it means a lot to all the contributors

Quickstart - Example

Create a new file, install the dependencies [1] and look at the skeleton code below to get you started quickly!

const nodemailer = require('nodemailer');
const mg = require('nodemailer-mailgun-transport');

// This is your API key that you retrieve from www.mailgun.com/cp (free up to 10K monthly emails)
const auth = {
  auth: {
    api_key: 'key-1234123412341234',
    domain: 'one of your domain names listed at your https://app.mailgun.com/app/sending/domains'
  }
}

const nodemailerMailgun = nodemailer.createTransport(mg(auth));

nodemailerMailgun.sendMail({
  from: '[email protected]',
  to: '[email protected]', // An array if you have multiple recipients.
  cc:'[email protected]',
  bcc:'[email protected]',
  subject: 'Hey you, awesome!',
  'replyTo': '[email protected]',
  //You can use "html:" to send HTML email content. It's magic!
  html: '<b>Wow Big powerful letters</b>',
  //You can use "text:" to send plain-text content. It's oldschool!
  text: 'Mailgun rocks, pow pow!'
}, (err, info) => {
  if (err) {
    console.log(`Error: ${err}`);
  }
  else {
    console.log(`Response: ${info}`);
  }
});

Buffer support

Example:

const mailOptions = {
    ...
    attachments: [
        {
            filename: 'text2.txt',
            content: new Buffer('hello world!','utf-8')
        },

with encoded string as attachment content:

const mailOptions = {
    ...
    attachments: [
        {
            filename: 'text1.txt',
            content: 'aGVsbG8gd29ybGQh',
            encoding: 'base64'
        },

with encoded string as an inline attachment:

// Replace `filename` with `cid`
const mailOptions = {
    ...
    attachments: [
        {
            cid: 'logo.png',
            content: 'aGVsbG8gd29ybGQh',
            encoding: 'base64'
        },
<!-- Reference the `cid` in your email template file -->
<img src="cid:logo.png" alt="logo" />

Address objects

The "from", "to", "cc", and "bcc" fields support an address object or array of address objects. Each "name" and "address" are converted to "name <address>" format. "name" is optional, "address" is required. Missing or null address in object is skipped.

Examples:

 from: {name: 'Sales', address: '[email protected]'},
 to: [{name:'Mary', address:'[email protected]'}, {address:'[email protected]'}]

is converted to:

Now with Consolidate.js templates, and also compatible with mailgun's own templates

This package has two options for templating - one is to allow mailgun's templating engine to process the template, and the other is to use templates in your own codebase using any templating engine supported by consolidate.js.

To use mailgun's templating engine (and allow templates to iterate independent of your codebase), simply pass the template name to the template key, and the template variables as a stringified JSON to the h:X-Mailgun-Variables key. Here's an example: ๏ฟผ

nodemailerMailgun.sendMail({
  from: '[email protected]',
  to: '[email protected]', // An array if you have multiple recipients.
  subject: 'Hey you, awesome!',
  template: 'boss_door',
  'h:X-Mailgun-Variables': JSON.stringify({key:'boss'})
}, (err, info) => {
  if (err) {
    console.log(`Error: ${err}`);
  }
  else {
    console.log(`Response: ${info}`);
  }
});

To use consolidate.js templates locally, give the template key an object instead that contains a name key, an engine key and, optionally, a context object. For example, you can use Handlebars templates to generate the HTML for your message like so:

const handlebars = require('handlebars');

const contextObject = {
  variable1: 'value1',
  variable2: 'value2'
};

nodemailerMailgun.sendMail({
  from: '[email protected]',
  to: '[email protected]', // An array if you have multiple recipients.
  subject: 'Hey you, awesome!',
  template: {
    name: 'email.hbs',
    engine: 'handlebars',
    context: contextObject
  }
}, (err, info) => {
  if (err) {
    console.log(`Error: ${err}`);
  }
  else {
    console.log(`Response: ${info}`);
  }
});

You can use any of the templating engines supported by Consolidate.js. Just require the engine module in your script, and pass a string of the engine name to the template object. Please see the Consolidate.js documentation for supported engines.

Mailgun Regions

You can use two different region environments for your mailgun domains. For USA region you should use api endpoint api.mailgun.net, but for EU region api.eu.mailgun.net

You can pass it as "host" to transport options object:

const nodemailer = require('nodemailer');
const mg = require('nodemailer-mailgun-transport');

const options = {
  auth: {
    api_key: 'key-1234123412341234',
    domain: 'one of your domain names listed at your https://mailgun.com/app/domains'
  },
  host: 'api.eu.mailgun.net' // e.g. for EU region
}

const nodemailerMailgun = nodemailer.createTransport(mg(auth));

[1] Quickly install dependencies

npm install nodemailer
npm install nodemailer-mailgun-transport

Legacy Node.js versions

Versions of Node.js before 7.6 are supported via nodemailer-mailgun-transport/es5.

const nodemailer = require('nodemailer');
const mg = require('nodemailer-mailgun-transport/es5');

nodemailer-mailgun-transport's People

Contributors

adrukh avatar adumaine avatar crossman avatar e110c0 avatar fossamagna avatar fry2k avatar giladbeeri avatar holm avatar iksoiks avatar ilshidur avatar j0ashm avatar jonnybgod avatar joshfriend avatar joshwillik avatar kentcdodds avatar maffoobristol avatar metamemoryt avatar mindmelting avatar mrbarbasa avatar orliesaurus avatar perzanko avatar richardlitt avatar rick4470 avatar sam-lord avatar stevepaulo avatar tol1 avatar trueter avatar viktorpeleshko avatar vinceprofeta avatar wmcmurray avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

nodemailer-mailgun-transport's Issues

TypeError: Cannot read property 'id' of undefined

I'm trying to send email via Nodemailer and Mailgun via this package.
I keep getting this error:
data: TypeError: Cannot read property 'id' of undefined at Object.send (/app/node_modules/nodemailer-mailgun-transport/src/index.js:126:51)

This is my code:

**
 * Server dependencies
 */
var app = require('express')();
app.use(function(req, res, next) {
    res.header("Access-Control-Allow-Origin", "*");
 });
var nodemailer = require('nodemailer');
var mailgun = require('nodemailer-mailgun-transport');
var templateDefault = require('./templates/templatedefault'); 
var logger = require('logger').createLogger('development.log');

/**
 * Socket configuration
 */
var http = require('http').createServer(app);

http.listen(process.env.PORT || 8080, function() {
    console.log('listening on *:8080');
});

var io = require('socket.io')(http, {
    pingInterval: 2000, // How many ms before the client sends a new ping packet
    pingTimeout: 5000, // How many ms without a pong packet to consider the connection closed
});
io.set('origins', '*:*');

/**
 * Sockets connection
 *
 * @param {param} socket Socket information
 */
io.on('connection', function(socket) {
    socket.on('userConnected', function(data) {
        var userId = data.userId;
        socket.userId = userId;
        socket.join(data.userId)
    });
    socket.on('notify', function(notificationData) {
        var notificationJson = JSON.stringify(notificationData);
        var notificationObject;
        try {
            notificationObject = JSON.parse(notificationJson);
            var notificationTemplate = new templateDefault(notificationObject.message.template).templateStructure();
            //Get specified template
            if(notificationTemplate){
            //Send email
            var mailOptions = {
                from: '[email protected]',
                to: notificationObject.message.sendTo,
                subject: notificationObject.message.subject,
                html: notificationTemplate
            };
            notify(io, mailOptions, notificationJson, socket, notificationObject); 
             }else{
                logger.info("Invalid Template");
                socket.broadcast.emit("error", {
                    data: "Invalid json data"
                }); 
             }
        } catch (e) {
            logger.info("Invalid JSON data", e);
            socket.broadcast.emit("error", {
                data: "Invalid json data"
            });
        }
    });
    socket.on('disconnect', function() {
        logger.info("User " + socket.userId + " disconnected");
        socket.leave(socket.userId);
    });
});

/**
 * E-mail authentication
 */
var auth = {
    auth: {
      api_key: 'MYKEY',
      host: "api.eu.mailgun.net/v3",
      domain: 'https://MYDOMAIN.net'
    }
}

/**
 * Send Email
 */
var nodemailerMailgun = nodemailer.createTransport(mailgun(auth));
function notify(io, mailOptions, notificationJson, socket, notificationObject) {
    nodemailerMailgun.sendMail(mailOptions, function (error, info) {
        logger.info("Received data:", notificationJson);
        if (error) {
            logger.info("Error sending email", error);
            socket.emit("error", { data: error });
        }
        else {
            logger.info(notificationObject.message.sendTo + " received an email with the following subject: " + notificationObject.message.subject, info.response);
            socket.emit("success", { data: notificationObject });
        }
    });
}

MailgunTransport.send() should not throw errs, but return them to the callback

The throw is currently causing my process to exit if I give it an invalid template file.

online ~62: if (err) throw err;
should instead be:
if ( err ) {
return done( err ) // will cause the async series result callback to be invoked with err
}

and ~121: if ( err ) throw err
should instead be:
if ( err ) {
callback( err )
}

messageId update not published to npm

PR #87 was merged 8 months ago. However, it seems this change was never published to npm, as the last update to npm was 9 months ago.

Could you publish the latest version to npm?

replyTo field not passing the message header

I am not 100% if this should be here or the nodemailer repo of @andris9. The issue I am coming across on the mailgun side is messages are being blocked when I set the from from email as the users email who is filling out our form when they have an AOL email address. I know I know... AOL, that aside.

I tried setting the from to an email address on my domain and set the replyTo field to the users AOL address so when we replied to the user in our email, it would reply to them and not our from address.

Unfortunately the replyTo field is never getting sent with the message header. Even when I send is in the mailOptions object.

I get this in the mailgun logs.

"headers": {
"to": "[email protected]",
"message-id": "[email protected]",
"from": "[email protected]",
"subject": "Email Subject Line"
},

This is the error I get in the logs from mailgun.

Failed: [email protected] โ†’ [email protected] 'Email Subject Line-8XU096659W0815542K3F4U7I' Server response: 550 550 5.7.1 Unauthenticated email from aol.com is not accepted due to domain's 5.7.1 DMARC policy. Please contact administrator of aol.com domain if this 5.7.1 was a legitimate mail. Please visit 5.7.1 https://support.google.com/mail/answer/2451690 to learn about DMARC 5.7.1 initiative. 95si11803781qgi.45 - gsmtp

Any help on the matter would be greatly appreciated.

Thank you.

Attachments?

Are attachments not supported? I haven't been able to get them to work. The same code using the sendgrid transport works fine.

Seems Ignoring headers

I tried to send email adding

headers: {
            "List-Unsubscribe": "<mailto:[email protected]>, <http://unsub.domain/member/unsubscribe/?listname=name&email=>"
        },

But it didn't sent with email

Template issue

I made template and gave all parameters it neede to send it.
but i'm receiving this error all the time:

Error: ENOENT: no such file or directory, open '../../views/email/verifyemail.ejs'
here is my code:
"use strict";
const crypto = require('crypto');
const nodemailer = require('nodemailer');
const mg = require('nodemailer-mailgun-transport');
const ejs = require('ejs');
const auth = {
	auth: {
		api_key: process.env.MAILGUN_API_KEY,
		domain: 'sandbox5454645445454545465656565.mailgun.org'
	}
};
const nodemailerMailgun = nodemailer.createTransport(mg(auth));
 //Send email to request email confirmation
module.exports.sendActivationEmail = (req, res, user, next) => {
	let token = crypto.randomBytes(20).toString("hex");
 	let contextObject = {
  		user: user,
  		token: token
	};
 		nodemailerMailgun.sendMail({
  		from: 'user 1 <[email protected]>',
  		to: user.email, // An array if you have multiple recipients.
  		subject: 'verify email',
  		template: {
    		name: '../../views/email/verifyemail.ejs',
    		engine: 'ejs',
    		context: contextObject
  		}
	}, function (err, info) {
  		if (err) {
    		console.log('Error: ' + err);
    		return next();
  		} else {
    		console.log('Response: ' + info);
    		next();
  		}
	});
};

I really don't know where should this verifyemail.ejs file be located so it can be found and sent out.
Cheers, Roman T

Inline CSS ?

Really awesome work @orliesaurus ! Love the plugin.

I'm using pug as template engine and I just can't figure out how to get it to work with either inline-css or Juice

Do you have any ideas?

TypeScript: 'template' does not exist in type 'Options'

I cannot specify a template. I have the following code:

import nodemailer from "nodemailer";
import mg from "nodemailer-mailgun-transport";
import dotenv from "dotenv";
import Mail from "nodemailer/lib/mailer";
import pug from "pug";

dotenv.config();

const {
    MG_API_KEY = "",
    MG_DOMAIN = "",
    MG_FROM_EMAIL = "",
    MG_FROM_NAME = ""
} = process.env;

const auth = {
    auth: {
        api_key: MG_API_KEY,
        domain: MG_DOMAIN
    },
};

const nodemailerMailgun = nodemailer.createTransport(mg(auth));

export interface IMailAddress {
    name?: string;
    address: string;
}

export const sendMail = (to: Mail.Address, subject: string, templateName: string, context: any = {}) => {
    return nodemailerMailgun.sendMail({
        from: { name: MG_FROM_NAME, address: MG_FROM_EMAIL },
        to, subject,
        template: {
            name: templateName,
            engine: 'pug',
            context: context
        }
    });
}

This is the error:
Object literal may only specify known properties, and 'template' does not exist in type 'Options'.

Multiple Tags

There is currently no way to add multiple tags since you pass options to nodemailer as an object.

Unhandled rejection Error: 'to' parameter

Hello!
I have stumbled across a problem that I can't fix. I am trying to send emails to a list of receivers, but the emails should contain individual properties, therefore I cannot just send a bulk email with an array of receivers.
My code looks as follows:
in my method call:

 _.forEach(data, function (user) {
   mailPromise = mail.sendTemplateMail(user.email, 'Status', '', user, type);
   mailPromises.push(mailPromise);
});
Promise.all(mailPromises).then(function (res) {
//do some error checking
});

the mail file:

function sendTemplateMail(recv, subj, text, data, type) {
    var context = {
        text: text,
        data: data || {},
    };
    return transporter.sendMail({
        from: admin,
        to: recv,
        subject: subj,
        template: {
            name: templates[type],
            engine: 'handlebars',
            context: context
        }
    });
}

This code has worked perfectly fine when I was using nodemailer-transport with gmail, but now I receive the following error, when an email address is not valid:

Unhandled rejection Error: 'to' parameter is not a valid address. please check documentation
    at IncomingMessage.<anonymous> (/home/fabio/node_modules/nodemailer-mailgun-transport/node_modules/mailgun-js/lib/request.js:301:15)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

What I would like to have is that I can use Promise.all to check if all the email promises were done properly.
Why is there error thrown an interrupts my procedures?

nodemailer URL attachment support

I wasn't able to make this kind of attachment work using the current version of the transport:

{   // use URL as an attachment
   filename: 'license.txt',
   path: 'https://raw.github.com/andris9/Nodemailer/master/LICENSE'
},

In a poor attempt to figure out what was going on it seems like the attachment path string is never turned into a stremeable (buffer) object, looks that the resolveContent method present in the mail object is intended to be used to do this kind of task (https://github.com/andris9/Nodemailer/blob/master/README.md#resolvecontent).

error callback param is undefined instead of null

I'm not sure if this is a problem with this library or the underlying mailgun library, but it could be fixed by this library regardless.

When an email successfully sends, the error callback param is undefined.

This goes against the nodejs callback pattern of using null in the absence of an error. source

Could you change the library to return a null error on success?
Alternately, would you accept a PR that did that?

when using template, plain text version is not sent

I use a template object as an email template in the transport.
as soon as I use template, the plaintext version doesn't work anymore.

Neither of this versions are working to send a plaintext email beside the Mime content.

          template: {
            name: 'views/email.pug',
            engine: 'pug',
            context: contextObject,
            text: `my Text and ${variable}` 
}

or

          text: `my Text and ${variable}`,
          template: {
            name: 'views/email.pug',
            engine: 'pug',
            context: contextObject,
}

thanks for any help!

Attachments not working

The attachments are added to the maildata message and also parameter not conforming to nodemailer "attachments" parameter instead of "attachment"

TypeError: Cannot read property 'api_key' of undefined

I have been using this package without issue in the past, but now get the above error when sending an email.

My code to send matches the documentation, e.g.:

 const auth = {
                auth: {
                    api_key: this.apiKey,
                    domain: this.domain,
                },
            };

const nodemailerMailgun = nodemailer.createTransport(mg(auth));

// send mail

This fails to work and gives the following error:

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'api_key' of undefined 

(node_modules/nodemailer-mailgun-transport/src/index.js:134:26)

Error: Forbidden inside Kubernetes

Using this inside of Kubernetes returns Forbidden without any other detail, both locally and on the server cluster. Works inside docker/docker compose. Other services accessing external APIs work. All services have access to the internal (tested with curl). Get the same error using mailgun/mailgun.js#79. Any ideas?

How to disable consolidate?

Hi,

I don't need templates. Is there a way to disable consolidate? Perhaps, a lite version?

I use Meteor. It aggressively searches for, and warns of absence of, npm packages that should have been installed, so I end up with >35 lines of complaints in my server log.

createTransport for each email?

Do I need to create the transport for each email I want to send or can I have this just outside the sendEmail function?

const transporter = nodemailer.createTransport(mg(auth));

const sendEmail = ({htmlBody, subject, email}) => {
  const mailOptions = {from: `"Super user" <${process.env.PARSE_SENDER_EMAIL}>`,to: email, subject, html: htmlBody };

//outside or inisde?
  const transporter = nodemailer.createTransport(mg(auth));

  transporter.sendMail(mailOptions, (error, info) => {
    if(error) console.log(error.message);
    else console.log(`Message sent: ${email},`, info);
  });
};

this is running on a node.js server

Url not found on server when trying to send an email

Hi,
I'm trying to use this node module, but when I try to send an e-mail I get:

<title>404 Not Found</title>

Not Found

The requested URL was not found on the server.

If you entered the URL manually please check your spelling and try again.

Will much appreciate your help. Thanks!

Uses /messages.mime endpoint

It seems like a more robust approach would be to use Mailgun's /messages.mime endpoint to send raw emails. This is what the nodemailer-ses-transport does, for example: nodemailer already gives you the mime-formatted email, and all you need to do is pipe that to Mailgun.

Econn Reset and socket hang ups

We've been running against mailgun with a nodejs microservice that uses nodemailer-mailgun-transport for well over a year. But since the past few days I'm seeing a lot of ECONN_RESET and Socket hang ups on the connections going to mailgun.

Is there anything that can possibly be done inside of here to prevent connection issues and socket hang ups from bubbling up the dep chain? AKA handle it internally in the package, or do we need to handle mailgun connection issues ourselves?

(ps: no changes were done on our side)

high severity vulnerability in netmask plugin

  1. What kind of issue are you reporting?
  • A bug in a plugin of nodemailer-mailgun-transport ^2.0.2 (netmask plugin)
  • High severity vulnerability
  1. State your problem here:
    Run "npm audit" or "npm install" with nodemailer-mailgun-transport ^2.0.2
    gives me:
    "netmask npm package vulnerable to octal input data"
    "patched in >=2.0.1"

Netmask is used by up to 300k live projects. Vulnerability reported on about two days ago.

feature: support mailgun templates

This transport supports templating in-house, but not pointing to one of mailgun's own templates.

A quick one-line hack to whitelist 'template' seems to work on our end, but I believe that would break the existing template functionality, so it would need either:

  1. pre-remove that template field if it's an object (kinda hacky)
  2. rename the existing template key to something else (backwards breaking)
  3. both (support "template" while deprecating it and encouraging the new key)

I'd be happy to PR but need some decisions made first.

I'm guessing you'll say option 3, so if so, what do you want the new name to be?

Thanks

NPM?

Hey Orlando great plugin, thank you very much. Would you mind putting it up on NPM for a little more permanency?

Error: apiKey value must be defined!

This isn't working at all for me. When apiKey is set it still throws Error: apiKey value must be defined! from the mailgun-js dependency.

MailGunTransport({
  auth: {
    apiKey: configService.emailApiKey, // tried hard coding this, the value is definitely set
    domain: configService.emailDomain,
  },
  host: 'api.eu.mailgun.net',
}),

Versions:
"nodemailer": "^6.4.16",
"nodemailer-mailgun-transport": "^2.0.1",

Why use this package?

I found the following code just working for me.
Any reason to use this package?

var transporter = nodemailer.createTransport({
    service: 'Mailgun',
    auth: {
        user: '[email protected]',
        pass: 'password'
    }
});

Mailgun error when template isset

I'm using nodemailer-mailgun-transport with loopback js.
When I try to send an e-mail I get the following error back from Mailgun

{ [Error: Sorry: template parameter is not supported yet. Check back soon!] statusCode: 400 }

Apparently, loopback js has a data.template property on the mail object provided as the first argument in the send method. They use it to generate the html provided in data.html, further it has no importance anymore.

When I put this in the send-method, everything works:

delete mail.data.template;

Could you add this line, just like you delete the mail.data.headers ?

Thx

Transport drops out Content-Disposition and Content-ID headers from attachments

I'm trying to send mail with embedded images through mailgun transport. I was expecting to see following headers in the received mail:

Content-Type: image/gif; name=timantti.gif
Content-ID: <[email protected]>
Content-Disposition: inline; filename=timantti.gif
Content-Transfer-Encoding: base64

but only

Content-Disposition: attachment; filename="timantti.gif"
Content-Type: image/gif; name="timantti.gif"
Mime-Version: 1.0
Content-Transfer-Encoding: base64

were passed...

Looks like many of the nodemailer options are just dropped here https://github.com/orliesaurus/nodemailer-mailgun-transport/blob/master/src/mailgun-transport.js#L83

replyTo not working

I've seen #19 but it seems the current code brought this bug back. If I 'h:Reply-To' field to the message configuration for nodemailer, all is fine. But this breaks with the normal configuration of nodemailer and it is not possible anymore to switch between nodemailer plugins.

High severity vulnerability introduced via `[email protected]`

Disclaimers:

  1. I work for Snyk.
  2. Snyk uses nodemailer-mailgun-transport in its backend.

There is a high severity vulnerability in nodemailer-mailgun-transport, introduced via [email protected] โ€บ [email protected] โ€บ [email protected]. See more details on the test report.

This can be remediated by upgrading the mailgun-js dependency version range from ^0.13.1 to ^0.17.0 or higher.

I'm more than willing to open the PR that does this, raising this issue first to get the maintainer's blessing.

Not allow array on 'to' field?

It ok to pass an array as receiver (e.g., to: ['[email protected]', '[email protected]']) if we want to send to multiple receivers at once. However, after upgrade to v1.3 it seems not work anymore and will show following error messages.

{ Error: 'to' parameter is not a valid address. please check documentation
    at IncomingMessage.<anonymous> (/Users/sylee/PositiveGrid/internal-modules/pg-mailer/node_modules/nodemailer-mailgun-transport/node_modules/mailgun-js/lib/request.js:309:15)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9) statusCode: 400 } { message: '\'to\' parameter is not a valid address. please check documentation' }

It's ok when I tried downgrade to v1.2.x

Publish 0.0.2 to npm

Hi there!

Can you please publish 0.0.2 to npm?
That would be really nice.

Greets
yaga

how to send mails to mailing list?

hi,

pls someone tell me how to send mails to mailing list from my front end.?
am using mailgun api. node as backend. just simple html for front end that has some sender and receiver, body of the message field. i can able to send mail successfully. but i want to send mailing list which in mailgun account. what am trying to say is. i have 50+ contacts in mailgun account named as " my demo list" i just want send mails to that list from my front end.

kindly share snippets or example code/tutorial/video links/ guidance pls..

thanks in advance

mailgun-js is no longer maintained

According to the mailgun-js README:

This library is no longer maintained. It was started over 6 years ago because we were Mailgun customers and needed a good Node.js client. Since then this module has become more popular then ever expected, and even official documentation references it. Likewise a lot has changed over the years. Due to various factors my employer nor I use Mailgun any more, and we have not for a couple of years now. I have attempted to maintain the library but over time that has proved to be increasingly more difficult as I do not use it and have no need for it. I have reached out to Mailgun to inquire if they would take over the module and repository but never received any meaningful response. I would be happy to add a well-intentioned contributor to maintain this; but I do not have the time, incentive, and plans to maintain this module any more.

Maybe you can take over the maintenance of mailgun-js, or migrate off it and use something else?

Edit:
There is mailgun.js that is maintained by mailgun itself.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.