nodemailer

Nodemailer whit GMail SMTP OAuth2 autentication is getting me 'Invalid status code 401'

随声附和 提交于 2019-12-11 05:49:06
问题 I'm trying to make a simple mail sender using Nodemailer 3, the GMail API whit OAuth2 autentication. Here's my script: var serverConfig = { gmail: { client_user : 'my@email.com', client_id : '349...myClientId', secret : 'mysecret..123jd123', refresh_token : 'x/xxxxxxxxxxxxxx-reZuEMeSuJaSERmCVY', access_token : 'xxxxxxxxxxxxxxxxx', expires: '3599' } } // 3LO authentication https://nodemailer.com/smtp/oauth2/#example-3 var transporter = nodemailer.createTransport({ service: 'gmail', auth: {

Node - options for sending email, sendgrid and nodemailer one of them or combined

走远了吗. 提交于 2019-12-10 20:44:56
问题 Not so experienced with sending email in node and as i can see there are different option to choose among. Which option to use in following scenario? Using node-mailer with sengrid: As i can see i must add additional package "nodemailer-sendgrid-transport" to force them to work together. Because var transporter = nodemailer.createTransport({ service: 'SendGrid', auth: {...}); won't work. (Always returning Bad username / password) var nodemailer = require('nodemailer'), sendGridTransport =

Nodemailer send emails using original user account instead of alias

喜你入骨 提交于 2019-12-10 20:09:11
问题 I have a problem with nodemailer where the user receive the email with sent from my google account which used to authenticate gmail instead of the alias used in mail options. Below is my code: var smtpTransport = nodemailer.createTransport({ service: config.mailer.options.service, auth: { user: "xxxx@gmail.com", pass: "password" } }); var mailOptions = { to: user.email, from: 'Test Email <aaa@aaa.com>', subject: subject, html: emailHTML }; smtpTransport.sendMail(mailOptions); Now when the

Accessing SMTP server with AUTH NTLM from Node.js

假装没事ソ 提交于 2019-12-10 19:31:37
问题 I'm trying to access a SMTP server with AUTH type of NTLM. I'm using nodemailer and nodemailer-smtp-transport as such: var config = require('./config.json'); var nodemailer = require('nodemailer'); var smtpTransport = require('nodemailer-smtp-transport'); var transporter = nodemailer.createTransport(smtpTransport({ host : config.mailer.host, port: config.mailer.port, auth: { user: config.mailer.username, pass: config.mailer.password }, authMethod: 'PLAIN' })); But it doesn't work. The error I

How to fix TypeError: Cannot read property 'name' from Express Nodemailer

五迷三道 提交于 2019-12-10 18:16:28
问题 So I do want to say that I've been searching for the answer for this and I've also tried to console.log my req.body post form and I keep getting undefined. So I feel that I'm losing the data from the form I send, I'm not sure what I"m doing wrong. So time to show some code. As a note: I am using Handlebars for my Express Setup. app.js var express = require('express'), exphbr = require('express3-handlebars'), // "express3-handlebars" nodemailer = require('nodemailer'), helpers = require('./lib

Heroku crash over and over by POST request, multer or nodemailer H=18

社会主义新天地 提交于 2019-12-10 17:26:56
问题 My deployment on Heroku keep crashing on the POST request when I send the mulitpart form. I can't see in the logs if it's on the upload (multer) function, save (mongoose) function or sendMail (nodemailer) function. The only thing I see in the logs is a H18 error: Internal Server. Router.js const express = require("express"); const mongoose = require("mongoose"); const router = express.Router(); const multer = require("multer"); const path = require("path"); const File = require("../models

Nodemailer getaddrinfo ENOTFOUND Error

假如想象 提交于 2019-12-10 16:28:16
问题 Looking for some insight into this error I'm getting. on smtpTransport.sendmail(func(err, info){}) The err variable returns this: Error: getaddrinfo ENOTFOUND smtp.gmail.com smtp.gmail.com:465 at errnoException (dns.js:50:10) at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26) and my code is: var smtpTransport = nodemailer.createTransport({ service: 'Gmail', auth: { user: 'xxx@gmail.com', pass: 'xxx' } }); var mailOptions = { to: user.email, from: 'xxx@gmail.com', subject: 'Node.js

Outlook HTML msg format from Javascript

廉价感情. 提交于 2019-12-10 15:32:30
问题 Is there any pure open source solution to parse Outlook msg format directly from Javascript and or NodeJS? I believe there is a need to support Outlook msg format in nodemailer, which at least parses eml correctly. So far I could not find a better approach than relying on the linux command line: Use msgconvert linux command to go from msg to eml: sudo apt install -y libemail-outlook-message-perl cd /tmp msgconvert test\ with\ html\ content.msg # creates test\ with\ html\ content.eml Use https

Nodemailer - MS Exchaneg server - Error unable to verify the first certificate

主宰稳场 提交于 2019-12-10 10:11:00
问题 I am trying to send email from NodeJS using out office MS Exchange Mail server. with below code. And get error Our Admin said no certificates are needed. Error:- $ node test2.js Error : { Error: unable to verify the first certificate at TLSSocket.onConnectSecure (_tls_wrap.js:1048:34) at TLSSocket.emit (events.js:182:13) at TLSSocket._finishInit (_tls_wrap.js:628:8) code: 'ESOCKET', command: 'CONN' } NodeJS Code:- "use strict"; const nodemailer = require("nodemailer"); async function main() {

Send email with Angular and NodeMailer

回眸只為那壹抹淺笑 提交于 2019-12-10 05:00:45
问题 how is it going? I am trying to figure out how to send an email with Angular 5 and Node.js -using nodemailer-. What I want to archive is when some user make an appointment in the page and system gets the provided email and send some information to the user when they click the button "Schedule my ....." As you'll see in appointment.component.ts , when the user click the button a variable change to "true" to display some hidden div to the user and displays as well a snackbar but nothing happens