简体   繁体   中英

How to use npm nodejs other than meteor nodejs in a meteor application

This is a spillover of my previous post Running bulk email with nodemailer in Meteor js application How to use npm nodejs other than meteor nodejs in a meteor application. I am randomly thinking of how I can use nodemailer because by default meteor 1.4 which I run runs on nodejs version 4.x. and this version can not be upgraded. I have nodejs version 7.x installed via npm on the same computer. Since nodemailer runs on version 6.x and above, how do I point the file to use npm node other than meteor node? I was advised here to install babel, which I did, but the error persists

You can not use nodeemailer in meteorjs. so, you need to use meteor packages from atmospherejs. for example:- mrt:meteor-nodemailer epaminond:nodemailer . there are many packages available.

Another way to tackle this is to get Meteor to save a record in the database for each email to be sent. You create another project in node, using express, or whatever framework you like, which looks at the mongo database for emails to send, and sends those out. It will need to update the record in the database to mark that it's sent, so that it won't send it again. You could set a timer so that it looks for work every minute, or shorter if you like.

That way this other project can use any version of node you like. It could even live on a different server as long as it can connect to the db.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM