nodemailer

External HTML file with CSS as email content in nodemailer

女生的网名这么多〃 提交于 2020-01-01 10:11:54
问题 Does anyone know how to tell Node.js´ module nodemailer to use an external HTML file (with links to stylesheets) as email content? I am able to type in HTML tags as email content but I prefer loading complete HTML files. I´m using nodemailer 1.3.0. Unfortunately I can´t find any example covering this issue for the actual nodemailer version. Ideas? 回答1: Use http://styliner.slaks.net It is a node.js package that allows you to inline your css, so that you can then use nodemailer to send the

External HTML file with CSS as email content in nodemailer

安稳与你 提交于 2020-01-01 10:11:46
问题 Does anyone know how to tell Node.js´ module nodemailer to use an external HTML file (with links to stylesheets) as email content? I am able to type in HTML tags as email content but I prefer loading complete HTML files. I´m using nodemailer 1.3.0. Unfortunately I can´t find any example covering this issue for the actual nodemailer version. Ideas? 回答1: Use http://styliner.slaks.net It is a node.js package that allows you to inline your css, so that you can then use nodemailer to send the

Not able to connect to outlook.com SMTP using Nodemailer

白昼怎懂夜的黑 提交于 2019-12-31 21:43:21
问题 I am creating the transport object like this. var transport = nodemailer.createTransport("SMTP", { host: "smtp-mail.outlook.com", // hostname secureConnection: false, // use SSL port: 587, // port for secure SMTP auth: { user: "user@outlook.com", pass: "password" } }); This is the error which I am getting, when I try to send the mail. [Error: 139668100495168:error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number:../deps/openssl/openssl/ssl/s3_pkt.c:337: ] When I tried setting

Not able to connect to outlook.com SMTP using Nodemailer

只愿长相守 提交于 2019-12-31 21:43:06
问题 I am creating the transport object like this. var transport = nodemailer.createTransport("SMTP", { host: "smtp-mail.outlook.com", // hostname secureConnection: false, // use SSL port: 587, // port for secure SMTP auth: { user: "user@outlook.com", pass: "password" } }); This is the error which I am getting, when I try to send the mail. [Error: 139668100495168:error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number:../deps/openssl/openssl/ssl/s3_pkt.c:337: ] When I tried setting

Mocking email function in nodejs

a 夏天 提交于 2019-12-31 19:21:04
问题 I've got a mailer function I've built and trying to shore up the coverage. Trying to test parts of it have proven tricky, specifically this mailer.smtpTransport.sendMail var nodemailer = require('nodemailer') var mailer = {} mailer.smtpTransport = nodemailer.createTransport('SMTP', { 'service': 'Gmail', 'auth': { 'XOAuth2': { 'user': 'test@test.com', 'clientId': 'googleClientID', 'clientSecret': 'superSekrit', 'refreshToken': '1/refreshYoSelf' } } }) var mailOptions = { from: 'Some Admin

how to show all console.log from node.js in heroku?

假装没事ソ 提交于 2019-12-31 11:02:12
问题 I have deployed a node.js application to node.js but not able to see the complete console.log statements from my app. I am using: heroku logs Some of the logging is shown but looks like it is not the complete logs. Is there a node.js package to send emails from the deployed app? Email works fine from my localmachine btw. Email code: console.log('try to send email hold on'); var nodemailer = require("nodemailer"); var smtpTransport = nodemailer.createTransport({ service: "Gmail", auth: { user:

how to show all console.log from node.js in heroku?

余生长醉 提交于 2019-12-31 11:02:02
问题 I have deployed a node.js application to node.js but not able to see the complete console.log statements from my app. I am using: heroku logs Some of the logging is shown but looks like it is not the complete logs. Is there a node.js package to send emails from the deployed app? Email works fine from my localmachine btw. Email code: console.log('try to send email hold on'); var nodemailer = require("nodemailer"); var smtpTransport = nodemailer.createTransport({ service: "Gmail", auth: { user:

Can I use nodemailer in browser?

拜拜、爱过 提交于 2019-12-30 11:06:13
问题 I've created a simple react redux app (using webpack ) with a contact form which when the user clicks submit I want to generate and send an email. To do this I have been trying to use nodemailer like so: import nodemailer from 'nodemailer'; //... sendEmail () { const emailInfo = { to: 'foo@bar.com', from: 'bar@foo.com', subject: 'Message from bar', text: 'Hello world!' }; const connectionInfo = { host: '...', port: 123, secure: true, auth: { user: 'foo@bar.com', pass: 'foo123' } }; const

Can I use nodemailer in browser?

此生再无相见时 提交于 2019-12-30 11:06:10
问题 I've created a simple react redux app (using webpack ) with a contact form which when the user clicks submit I want to generate and send an email. To do this I have been trying to use nodemailer like so: import nodemailer from 'nodemailer'; //... sendEmail () { const emailInfo = { to: 'foo@bar.com', from: 'bar@foo.com', subject: 'Message from bar', text: 'Hello world!' }; const connectionInfo = { host: '...', port: 123, secure: true, auth: { user: 'foo@bar.com', pass: 'foo123' } }; const

node js SMTP error

耗尽温柔 提交于 2019-12-30 06:18:46
问题 I am sending e mail through my godaddy email account. For that i am using node js for sending emails but it is giving following error : { [Error: getaddrinfo ENOTFOUND] code: 'ENOTFOUND', errno: 'ENOTFOUND', syscall: 'getaddrinfo' } Source code: var transporter = nodemailer.createTransport({ host: 'ssl://smtpout.secureserver.net', port: 465, auth: { user: 'Email address', pass: 'password' } }); var mailOption = { from: from, to: to , subject: subject, text: body }; transporter.sendMail