Hello,
I am testing nodemailer on my node.js localbased server and I keep getting SMTP related errors. All ports giving the same errors:
[2024-05-23 05:42:40] DEBUG Sending mail using SMTP/6.9.13[client:6.9.13]
[2024-05-23 05:42:42] DEBUG [DPbtBTaxh6U] Resolved localhost as ::1 [cache miss]
[2024-05-23 05:42:42] ERROR [DPbtBTaxh6U] connect ECONNREFUSED ::1:587
[2024-05-23 05:42:42] DEBUG [DPbtBTaxh6U] Closing connection to the server using "destroy"
[2024-05-23 05:42:42] ERROR Send Error: connect ECONNREFUSED ::1:587
Error sending email: Error: connect ECONNREFUSED ::1:587
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1602:16) {
errno: -4078,
code: 'ESOCKET',
syscall: 'connect',
address: '::1',
port: 587,
command: 'CONN'
}
I tried to ping the smtp ports on localmachine and no of them (25, 2525, 587, 465) are working.
I have checked the services.msc and could not find Simple Mail Transfer Protocol (SMTP) service at all.
I have a feeling that because of this service is missing, i cant send emails with nodemailer.
I am using https://mailtrap.io/ and its provided instructions how to use smtp.
var transport = nodemailer.createTransport({
2 host: "sandbox.smtp.mailtrap.io",
3 port: 2525,
4 auth: {
5 user: "838e9be05a94db",
6 pass: "********c98c"
7 }
8});
Their smtp server is working fine. Just mine localmachine servers arent pinging.
Please help to solve this.