Send mail with Mandrillapp and Node.js

by Dani Arlandis — on  ,  , 



  • Node 0.6+
  • NPM
  • RequireJS
  • Have a count in Mandrillapp


First we have to install Mandrill's API with npm package manager

npm install mandrill-api

How to use

To use the library you can simply declare an instance of Mandrillapp.

var mandrill = require('mandrill-api/mandrill');
var mandrill_client = new mandrill.Mandrill('YOUR_API_KEY');

We're almost ready to make requests and only need to configure SPF and DKIM and Check our domain.

Official documentation

Once you configured the domain we can use the API Mandrill:

var mandrill = require('mandrill-api/mandrill');

mandrill_client = new mandrill.Mandrill('YOUR_API_KEY');

var message = {
    "html": "contenido html",
    "text": "Ejemplo en texto",
    "subject": "Asunto",
    "from_email": "",
    "from_name": "Nombre de ejemplo",
    "to": [{
        "email": "",
        "name": "User",
        "type": "to"
    "headers": {
        "Reply-To": ""

var async = false;

var ip_pool = "Main Pool";

        "message": message, "async": async, "ip_pool": ip_pool
    function(result) {//Do something},
    function(e) {//Error handler}