lib/mai.js
function(conf) {
        if (!conf) {
            throw new Error("'conf' is required");
        }

        var text, headers, message, smtpClient,
            callback = conf.callback || function(){};

        text = this._buildTemplate(conf.templateName, conf.params);
        headers = this._buildHeaders(conf, text);
        message = email.message.create(headers);
        this._processAttachments(message, conf.attachments);
        
        debug(message);
        
        if (ENV !== 'test') {
    				smtpClient = new email.server.connect(this.smtpConf);
            smtpClient.send(message, callback);
        } else {
            conf.callback.call(this, null, message);
        }
    }
function(conf) {
        if (!conf) {
            throw new Error("'conf' is required");
        }

        var text, headers, message, smtpClient,
            callback = conf.callback || function(){};

        text = this._buildTemplate(conf.templateName, conf.params);
        headers = this._buildHeaders(conf, text);
        message = email.message.create(headers);
        this._processAttachments(message, conf.attachments);
        
        debug(message);
        
        if (ENV !== 'test') {
    				smtpClient = new email.server.connect(this.smtpConf);
            smtpClient.send(message, callback);
        } else {
            conf.callback.call(this, null, message);
        }
    }
function ( conf ) { if ( ! conf ) { throw new Error ( "'conf' is required" ) ; } var text , headers , message , smtpClient , callback = conf . callback || function ( ) { } ; text = this . _buildTemplate ( conf . templateName , conf . params ) ; headers = this . _buildHeaders ( conf , text ) ; message = email . message . create ( headers ) ; this . _processAttachments ( message , conf . attachments ) ; debug ( message ) ; if ( ENV !== 'test' ) { smtpClient = new email . server . connect ( this . smtpConf ) ; smtpClient . send ( message , callback ) ; } else { conf . callback . call ( this , null , message ) ; } }
Send e-mail.

@param {Object} conf Configuration.
- from {String} Sender of the format (address or name <address> or "name" <address>)
- to {String} Recipients (same format as above), multiple recipients are separated by a comma
- cc {String} [optional] Carbon copied recipients (same format as above)
- bcc {String} [optional] Blind carbon copied recipients (same format as above)
- subject {String} Subject of the email
- templateName {String} Template name to send
- params {Object} [optional] Parameter to bind to template
- attachments {Array.<Object>}
- path {String} String to where the file is located
- type {String} String of the file mime type
- name {String} Name to give the file as perceived by the recipient
- callback {Function} [optional] Callback function, which called when send finished.
Send e - mail .