Skip to content Skip to sidebar Skip to footer

Using Nodemailer And Smtp Send Mail Without Authentication

Below is my code. This works fine with gmail smtp server. But when I use my office one (which does not require authentication) it fails May be the syntax I am using is wrong. below

Solution 1:

You can remove auth option from the example code when creating an SMTP Transport message.

so it should look like the following:

  /**
   * Initialize transport object
   */
  const transporter = nodemailer.createTransport({
    host: "", //Host
    port: , // Port 
    secure: true
  });

    let mailOptions = {
      from: , // sender address
      to: , // list of receivers
      subject: , // Subject line
      text: , // plain text body
      html: // html body
    };

    /**
     * send mail with defined transport object
     */
    transporter.sendMail(mailOptions,
      (error, info) => {

      });

Post a Comment for "Using Nodemailer And Smtp Send Mail Without Authentication"