Using Webmail with Nodemailer

I solved the problem by following the steps below.

  1. I installed a module: nodemailer-smtp-transport.

     const smtpTransport = require('nodemailer-smtp-transport');
    
  2. I corrected the host name and some options.

    host:'mail.mydomani.ro'
    secureConnection: false,
    tls: {
       rejectUnauthorized: false
     }
    

3)I integrated the module nodemailer-smtp-transport in the transporter.

 const transporter = nodemailer.createTransport(smtpTransport({
    host:'mail.mydomanin.ro',
    secureConnection: false,
    tls: {
      rejectUnauthorized: false
    },
    port: 587,
    auth: {
        user: process.env.EMAIL_SEND_SESSION,
        pass: process.env.EMAIL_SEND_PASSWORD,
  }
}));

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top