cpanel email using node js nodemailer not sent mail to inbox?

Viewed 20

while using cpanel email and nodemailer to send mail to my app user i get email sent with no errors but email don`t get in reciever inbox I using the below code

const mailOptions = {
from: "my user@gofootball.net",
to:email,
subject: 'New feedback email',
text: "hello form go sports"
};

const transporter = nodemailer.createTransport(smtpTransport({
host:'mail.gofootball.net',
port: 465 ,
secureConnection: false,
debug:true,
tls: {
rejectUnauthorized: false
},
auth: {
  user: 'my user@gofootball.net',
  pass: 'my user pass'
}
}));

1 Answers

Everything seems to be absolutely correct, except the following option:

'secureConnection: false,'

Since you are using port 465, which is the SSL SMTP port, the secureConnection should be set to true instead. This is most probably the reason for your issue. Otherwise, you might want to double-check the SMTP details that you use.

Related