mailgunner
v0.0.1
Published
http mailgun module, a quick way to send an email to one or many recipients using the mailgun api
Downloads
10
Maintainers
Readme
npm install mailgunner
Example code
var MailGun = require("mailgunner");
var from = "[email protected]";
var domain = "your_mailgun_domain.com";
var apiKey = "your_mailgun_api_key";
var configObj = {
domain:domain,
from:from,
apiKey:apiKey
};
var mailgunner = new MailGun(configObj);
mailgunner.setHtml("<h1>Testing mailgunner module</h1>");
mailgunner.setSubject("Mailgun Test");
mailgunner.addRecip("[email protected]");
// or add people/recips by array
mailgunner.addRecipArray(["[email protected]","[email protected]","[email protected]"]);
mailgunner.send();
environment variable
if you dont want to pass in your apiKey all the time, you can set the ENV VAR MAILGUN_KEY by exporting it to your environment or you can set it like this with node process.env.MAILGUN_KEY = "fjdkgjfd"