nodemailer

Can't send Emails with attachments with nodemailer

心不动则不痛 提交于 2019-12-12 05:14:10
问题 I have the following function for sending emails with attachments using nodemailer, but sometimes It returns error enoent, the file path can't be found even if it exists. Can you tell me where is my mistake? function sendEmail(userEmail, htmlString, requestSnap, FIREBASE_WEB) { fileName ="test.pdf"; folderName = "./" + uuid.v4(); mkdirp(folderName, function(err) { if (err) console.error(err) else console.log(folderName + ' folder created!') }); pdf.create(htmlString + userEmail, options)

Nodemailer sends email witthout error, but I received nothing

血红的双手。 提交于 2019-12-12 04:43:59
问题 function sendMail(uid) { var emailRef = admin.database().ref("users/"+uid+"/email"); emailRef.once("value", function(snapshot) { var email = snapshot.val(); if (email !== null && email != undefined && email != "") { fs.readFile('Key/mail.json', 'utf8', function (err, data) { if (err) throw err; objMail = JSON.parse(data); console.log("MAIL OBJECT:"+ objMail.text); var transporter = nodemailer.createTransport('smtps://email%40mywebsite.com:'+objMail.text+'@smtp.gmail.com'); var mailOptions = {

Send multipe emails using nodemailer and gmail

若如初见. 提交于 2019-12-12 01:54:27
问题 I am trying to send an email to multiple recipients ( about 3.000 ). All emails are stored in my DB ( Mongo ). So I make a query that return all the email addresses, and I use async to send all the emails, like: function _sendEmail(params, callback) { async.each(params.email, function(user, cb) { const mailOptions = { from: sender to: user, subject: Subject, text: 'Hello Word', }; app.transporter.sendMail(mailOptions, function(err, response) { if(err) console.log(err); else console.log

Mail not send by nodemailer

血红的双手。 提交于 2019-12-11 18:10:49
问题 I am trying to send mail using nodemailer but the code is not sending the mail also not showing any error. By user input add to, from, subject, a message from the ejs form and using nodemailer I want to send the mail to Gmail account but it's not sending. Please any help mail.ejs <div class="card"> <div class="card-header"> <p> <b>Send mail</b> </p> </div> <br/> <form action="/send-email" method="post"> <div class="col-md-12" style="overflow-x:auto;"> <div class="form-group"> <input type=

Nodemailer throws error on Azure

跟風遠走 提交于 2019-12-11 17:08:20
问题 I'm trying to use the nodemailer package in my NodeJS app, which I have deployed on Azure. If I execute the app on my localhost everything works fine. If I execute it on Azure it throws the following error: Thu Jan 25 2018 09:03:31 GMT+0000 (Coordinated Universal Time): Application has thrown an uncaught exception and is terminated: SyntaxError: Unexpected token ... at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:373:25) at Object.Module._extensions..js (module.js:416

Running bulk email with nodemailer in Meteor.js application

爱⌒轻易说出口 提交于 2019-12-11 16:59:27
问题 I am trying to use nodemailer in an application. After following an SO thread here Is it possible to to send bulk pre-rendered email via the SendGrid API?, I kept on getting the below error which suggested it is a version problem. As stated on the nodemailer page that version 6- upward is required, and presently I'm running on version 7.4.0, and still getting the error. This is my implementation: var nodemailer = require("nodemailer"); if (Meteor.isServer) { Meteor.methods({ MassMail:

how to fix err:Failed to load PDF document once sent by nodemailer attachments?

时光毁灭记忆、已成空白 提交于 2019-12-11 15:06:27
问题 I got an app which sending emails with attachments using Nodemailer. First I'm using multer to save the attachment on the server (working well) so I can pass the path of the file to attachments in the nodemailer route. The email and attachment is successfully sent but the attachment failed to be opened/read! Here is the nodemailer route: app.post("/send", function(req,res){ var transporter = nodemailer.createTransport({ service: 'gmail', auth: { user: 'my gmail', pass: 'my pass' } }); var

sending mail in cloud9.io

一笑奈何 提交于 2019-12-11 10:40:01
问题 I am running a sails.js project using nodemailer locally which is working well.Nodemailer use Smtp and Gmail's service.Problem is when i transfer my project on cloud9 it is blocking mail. smtpTransport = nodemailer.createTransport('SMTP', { host: 'smtp.gmail.com', port: 25, service: 'Gmail', auth: { user: model.sender, pass: model.password } }); here is configurations and error is: { [Error: connect ETIMEDOUT] code: 'ETIMEDOUT', errno: 'ETIMEDOUT', syscall: 'connect', stage: 'init' } from

Nodemailer email confirmation using Async/Await

最后都变了- 提交于 2019-12-11 07:36:59
问题 I am sending mails using nodemailer. I need to know if the mail is sent or not and then update my database but the mail is sent in the transporter(which I do not think returns promises) which takes time and hence the return is always false, even if the mail is sent. This is my mail sending file which I call from other routes //mail_file.js //imports sendmail= async(req)=>{ let transporter = nodemailer.createTransport({ //settings }); var mailOptions = { //mailoptions }; let resp=false; await

Nodemailer doesn't work correctly Full React & Redux Project with Node and Express

偶尔善良 提交于 2019-12-11 07:21:57
问题 I have a React website that is just plain, informative website for the Homeless community. It also has the contact us form pages with Nodemailer in Nodejs. It's been deployed in Ubuntu 16.04. But now I want to add Full MERN stack to the website along with those informative web pages. Its has Login and Register with JWT and Passport. When I logged into the website and trying to use the contact us form, doesn't send the mail. If logout , Nodemailer works perfectly. I don't know if it's