1

I want to send my website mails by 3rd party mail server using Nodemailer. When I send mails from my pc everything is ok but from my host No. I set mail server MX records on Cpanel.

let transporter = nodemailer.createTransport({
    host:'smtp.mailserver.com',
    port: 587, //25
    secure : false,
    auth: {       
        user: username,
        pass: password,
        },
    tls: {
        rejectUnauthorized: false,
    },
    debug: true, // show debug output
    logger: true // log information in console
});

this is my PC logs that send mails correctly. image

and this is my nodejs Host logs. enter image description here

250-nodejsHOSTadress.net Hello nodejsHOSTadress.net

I tried port 465 too.

let transporter = nodemailer.createTransport({
    host:'smtp.mailserver.com',
    port: 465,
    secure : true,
    auth: {       
        user: username,
        pass: password,
        },
    debug: true, // show debug output
    logger: true // log information in console
});

But I occurred this error. enter image description here
I changed my mail server provider and I tried thereal.email too but same results.

stack CVL
  • 15
  • 6

0 Answers0