Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

automated email sending using node js server

let transport = nodemailer.createTransport({
      host: "smtp.gmail.com",
      port: 465,
      secure: true,
      auth: {
        user: process.env.EMAIL_USER,
        pass: process.env.EMAIL_PASS, // here provide the app password you obtained instead of the user password of your google account.
      },
    });

    const mailOptions = {
      from: "from@gmail.com",
      to: "to@gmail.com",
      subject: "Hello from nodemailer",
      text: `${message}`,
      html: `<h1>${message}</h1>`,
    };

    const result = await transport.sendMail(mailOptions); 
// as I am using a async function I am using the promise pattern, but you can also use callback pattern.
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to create my own filter in js 
Javascript :: vue js multiple dynamic classes 
Javascript :: check identical array javascript 
Javascript :: star print in javascript 
Javascript :: luhn algorithm javascript 
Javascript :: pass ? url data 
Javascript :: router react how to pass data to class component 
Javascript :: mdn bind 
Javascript :: js create jaon object from for loop 
Javascript :: convert datetime value to time only in reactjs 
Javascript :: share data between livewire and alpine js 
Javascript :: javascript check number length 
Javascript :: javascript loop array 
Javascript :: freenom 
Javascript :: react copy array 
Python :: months list python 
Python :: matplotlib plot dashed 
Python :: how to change django admin text 
Python :: python b to string 
Python :: how to convert a column to datetime in pandas 
Python :: time format conversion in python 
Python :: play video in google colab 
Python :: find time of run for python code 
Python :: python actualizar pip 
Python :: how to talk to girls 
Python :: how to simulate a key press in python 
Python :: use incognito mode in selenium 
Python :: python dataframe rename first column 
Python :: check 32 or 64 bit python 
Python :: add seconds to datetime python 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =