SMTP informationI'm getting this error :-
Error: connect ETIMEDOUT 144.76.97.27:25
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1132:16)
{
errno: -4039,
code: 'ESOCKET',
syscall: 'connect',
address: '144.76.97.27',
port: 25,
command: 'CONN'
}
my code is:-
let transporter = nodemailer.createTransport({
host: "mail.tusharjoshi.tech",
port: 25,
secure: false, // true for 465, false for other ports
auth: {
user: "contact@tusharjoshi.tech", // generated ethereal user
pass: "mypAssword" // generated ethereal password
},
tls: {
// do not fail on invalid certs
rejectUnauthorized: false
}
});
const mailOptions = {
from: "tusharjoshi.tech",
to: "hellotusharr2318@gmail.com",
subject: `message from ${req.body.name}`,
text: `Message recieved from ${req.body.email}: and message is about: ${req.body.message}`
};
transporter.sendMail(mailOptions, (error, info) => {
if (error) {
console.log(error);
res.send("error");
} else {
console.log("send");
res.send("success");
}
});
did you check this answer? nodemailer SMTP server connection issue (Error: connect ETIMEDOUT) but it works for another system not in mine