lib/smtp-transport.js
function SMTPTransport(options) {
    EventEmitter.call(this);

    options = options || {};
    if (typeof options === 'string') {
        options = {
            url: options
        };
    }

    var urlData;
    var service = options.service;

    if (typeof options.getSocket === 'function') {
        this.getSocket = options.getSocket;
    }

    if (options.url) {
        urlData = shared.parseConnectionUrl(options.url);
        service = service || urlData.service;
    }

    this.options = assign(
        false, // create new object
        options, // regular options
        urlData, // url options
        service && wellknown(service) // wellknown options
    );

    this.logger = shared.getLogger(this.options);

    // temporary object
    var connection = new SMTPConnection(this.options);

    this.name = 'SMTP';
    this.version = packageData.version + '[client:' + connection.version + ']';
}
function SMTPTransport(options) {
    EventEmitter.call(this);

    options = options || {};
    if (typeof options === 'string') {
        options = {
            url: options
        };
    }

    var urlData;
    var service = options.service;

    if (typeof options.getSocket === 'function') {
        this.getSocket = options.getSocket;
    }

    if (options.url) {
        urlData = shared.parseConnectionUrl(options.url);
        service = service || urlData.service;
    }

    this.options = assign(
        false, // create new object
        options, // regular options
        urlData, // url options
        service && wellknown(service) // wellknown options
    );

    this.logger = shared.getLogger(this.options);

    // temporary object
    var connection = new SMTPConnection(this.options);

    this.name = 'SMTP';
    this.version = packageData.version + '[client:' + connection.version + ']';
}
function SMTPTransport ( options ) { EventEmitter . call ( this ) ; options = options || { } ; if ( typeof options === 'string' ) { options = { url : options } ; } var urlData ; var service = options . service ; if ( typeof options . getSocket === 'function' ) { this . getSocket = options . getSocket ; } if ( options . url ) { urlData = shared . parseConnectionUrl ( options . url ) ; service = service || urlData . service ; } this . options = assign ( false , // create new object options , // regular options urlData , // url options service && wellknown ( service ) // wellknown options ) ; this . logger = shared . getLogger ( this . options ) ; // temporary object var connection = new SMTPConnection ( this . options ) ; this . name = 'SMTP' ; this . version = packageData . version + '[client:' + connection . version + ']' ; }
Creates a SMTP transport object for Nodemailer

@constructor
@param {Object} options Connection options
Creates a SMTP transport object for Nodemailer