Я хочу настроить контактную форму, поэтому для тестирования я использую почтовую программу узла и почтальона, но получаю эту ошибку
Client network socket disconnected before secure TLS connection was established
Вот мой код:
const transporter = nodemailer.createTransport({
host: 'smtp.itcarver.com',
port: 587,
secure: false,
auth: { user: 'support@itcarver.com', pass: 'xyz' },
tls: { rejectUnauthorized: false }
});
const mailOptions = {
from: 'support@itcarver.com',
to: "xyz",
subject: "subject",
text: "test",
};
transporter.sendMail(mailOptions, function(error, info) {
if (error) {
console.log(error)
res.send("error");
} else {
res.send('Email sent: ');
}
});
А вот и ошибка:
Error: Client network socket disconnected before secure TLS connection was established
at connResetException (internal/errors.js:604:14)
at TLSSocket.onConnectEnd (_tls_wrap.js:1513:19)
at Object.onceWrapper (events.js:417:28)
at TLSSocket.emit (events.js:323:22)
at endReadableNT (_stream_readable.js:1204:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
code: 'ESOCKET',
path: undefined,
host: 'smtp.itcarver.com',
port: undefined,
localAddress: undefined,
command: 'CONN'
}