Giter Site home page Giter Site logo

express-mail's People

Contributors

sorich87 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

brexis tekxl

express-mail's Issues

Does express-mail support Express 4?

Hello, does express-mail support Express 4 ?

I'm running into this error when I run the example:

/Users/antoniobrandao/WEBROOT/ABWA/express/app.js:52
app.send('mail', mailOptions, function (error, response) {
^
TypeError: Object function (req, res, next) {
app.handle(req, res, next);
} has no method 'send'
at Object. (/Users/antoniobrandao/WEBROOT/ABWA/express/app.js:52:5)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/Users/antoniobrandao/WEBROOT/ABWA/server.js:3:13)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
[gulp] [nodemon] app crashed - waiting for file changes before starting...
[BS] Reloading Browsers...
[gulp] [nodemon] restarting due to changes...
[gulp] [nodemon] starting node server.js

/Users/antoniobrandao/WEBROOT/ABWA/express/app.js:25
expressMail.extend(app, {
^
TypeError: Object function extend(options) {
var defaults = {
generateTextFromHTML: true
};
var stub = nodemailer.createTransport('STUB', options.config);
var transport = nodemailer.createTransport(options.transport, options.config);

defaults = merge(defaults, options.defaults);

/**

  • Close current transport and replace it with a new one.
    *

  • @param {Object} options

  • @param {Function} cb

  • @api private
    */
    function reload(options, cb) {
    transport.close(function (err) {
    if (err) {
    if (cb) {
    cb(err);
    }
    return;
    }

    defaults = merge({}, options.defaults);
    transport = nodemailer.createTransport(options.transport, options.config);
    
    if (cb) {
      cb();
    }
    

    });
    }

    return function (req, res, next) {
    var app = req.app;
    var ext = app.get('view engine');
    var root = app.get('views');

    if (ext[0] !== '.') {
    ext = '.' + ext;
    }

    app.mail = {
    reload: reload,
    send: sendFactory(transport, app.render.bind(app), root, ext, defaults),
    stub: sendFactory(stub, app.render.bind(app), root, ext, defaults)
    };

    res.mail = {
    reload: reload,
    send: sendFactory(transport, res.render.bind(res), root, ext, defaults),
    stub: sendFactory(stub, res.render.bind(res), root, ext, defaults)
    };
    next();
    };
    } has no method 'extend'
    at Object. (/Users/antoniobrandao/WEBROOT/ABWA/express/app.js:25:13)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object. (/Users/antoniobrandao/WEBROOT/ABWA/server.js:3:13)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    [gulp] [nodemon] app crashed - waiting for file changes before starting...
    [BS] Reloading Browsers...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.