'sending email failed from NodeJS
I am trying to send mail from my NodeJS backend application, but am getting some error :-
Error: self signed certificate in certificate chain
at TLSSocket.onConnectSecure (_tls_wrap.js:1497:34)
at TLSSocket.emit (events.js:315:20)
at TLSSocket._finishInit (_tls_wrap.js:932:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:706:12) {
code: 'ESOCKET',
command: 'CONN'
How can I fix this? The same function is working in some other machines (in local) I think am missing something to configure or install..!
sendMail() {
try {
let info = await this.transporter.sendMail({
from: '[email protected]',
to: user.email,
subject: "Subject",
html: `<p>mail content</p>`,
attachments: [{
filename: 'logo.png',
path: join(__dirname, '..images/logo.png'),
}]
});
} catch (error) {
return console.error(error);
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
