Logo

dev-resources.site

for different kinds of informations.

nodeMailer after google security update

Published at
10/26/2023
Categories
nodemailer
node
nodemailerlatest
webdev
Author
manu1305
Author
8 person written this
manu1305
open
nodeMailer after google security update

Node mailer

most of them know Node mailer but with latest security update of google some of them not able to use Node mailer , Don't worry I will help you to resolve your issue ... if you are a beginer you can also follow this documentation....Let's start

step 1

install node mailer in your server

npm install nodemailer

step 2

Add this code

**const nodemailer = require('nodemailer')

const sendmail= async (req, res) => {

const { email } = req.body;

let transporter = nodemailer.createTransport({

host: "smtp.gmail.com",

port: 465,

secure: true,

auth: {

  user: "[email protected]",

  pass: "***",

},
Enter fullscreen mode Exit fullscreen mode

});

try {

// send mail using optional parameters

var mailOptions = {

  from: "[email protected]",
Enter fullscreen mode Exit fullscreen mode

// here you an replace email with custom email name //

  to: email,



  subject: "Type your e-mail subject here",



  html: `

  <img style="width:100px;height:40px;object-fit:contain" src="https://example/Image/example.jpeg" alt="Yourimge">

    <h2Email recciewvedlick Here  to test </h2>

  `,

};



// get the response

transporter.sendMail(mailOptions, function (error, info) {

  if (error) {

    console.log(error);

  } else {

    console.log("Email sent: " + info.response);



    return res.status(200).json({ success: true, message: info.response });

  }

});
Enter fullscreen mode Exit fullscreen mode

} catch (err) {

console.log(err);
Enter fullscreen mode Exit fullscreen mode

}

};
**

inside auth we need to give password i mentioned in top the google is updated the security information so we need to follow the latest updates

so follow me to get your password

  1. You need to secure your google account with two step verification

  2. next go to this link

** https://myaccount.google.com/apppasswords?pli=1&rapt=AEjHL4NSosO4ykDzkOiQw_CZ7_oQRKcZutIJFw7_S7zLmf5nv0GsqoTSmbNQKJ6YzDuR8DM3sUSMoXQvQ7gVeCdGXuLaZKY-dg
**

  1. Then you add any custom name and then you will get 16 digit password copy that password

and add that password inside the auth in given code above

remember one thing email also replace with your email which created app password

(26
-10-2023)

official documentation : https://nodemailer.com/

If there is still a problem contact me :

https://https://www.linkedin.com/in/manu1305/

whatsapp :+91 8943293217

nodemailer Article's
30 articles in total
Favicon
Brevo smtp emails to other gmail accounts silently failing , verified domain to the rescue
Favicon
Send emails using Nodemailer (Typescript)
Favicon
Simple Emails Sending from Node.js Using Nodemailer and SMTP
Favicon
Practical Guide to Send Emails from NodeJS/Express App using Gmail and Nodemailer (Screenshots and Code)
Favicon
Sending Emails in NextJs via Nodemailer
Favicon
Sending Emails in Node.js Using Nodemailer
Favicon
Sending e-mails with Sendgrid
Favicon
NestJS Emails with react-email and nodemailer
Favicon
nodeMailer after google security update
Favicon
Beginner’s Guide On Sending Automated Emails With Node.js, Nodemailer, and Cron Jobs
Favicon
Tracking Email Activity from AWS Simple Email Service (SES)
Favicon
Envio de email com NodeJS e Gmail
Favicon
Setting up Node.js Email Server with Nodemailer and Mailtrap
Favicon
Sending Emails from a Nodejs Application using Nodemailer
Favicon
Dynamic emails with handlebars and nodemailer
Favicon
Sending e-mails with Mailtrap
Favicon
Simple Next.JS Form to Email Using React-Hook-Form and Gmail
Favicon
How to send Email with NodeJS in 2022
Favicon
How to send email attachments using nodemailer
Favicon
Send emails from your website to any user super easily!
Favicon
How to Send an Email with Nodemailer
Favicon
Send email using next.js, react-hook-form, tailwindcss & nodemailer
Favicon
Nextjs - Nodemailer - React Hook Form - Tailwindcss
Favicon
How to send mail using Nodemailer?
Favicon
I created my own email server to send emails into my gmail for My Portfolio
Favicon
How to send mail using nodemailer in Angular 11?
Favicon
How I met your...Scraper?
Favicon
Отправка писем в NestJS используя nodemailer. Публикация скриптов.
Favicon
3 ways to send emails with only few lines of code and Gmail - Javascript - Part 1
Favicon
NodeJS – Send email by Nodemailer

Featured ones: