The problem is this line:
smtpTransport.close();
You can avoid the ReferenceError
by binding the callback to the context of your mailer.
this.smtpTransport.sendMail({ /* options */ }, function (err, response) {
// do stuff
this.smtpTransport.close();
}.bind(this));
It would also make more sense to put send
as a method on the prototype, because it uses the state of the instance.
Emailer.prototype.send = function () {
// this.smtpTransport ...
};
Finally, I would name it Email
instead of Emailer
:)