I want to send an email from NodeJs. I did a quick search on npmjs.org and found 2 promising libraries:
and
First, I followed the instructions to install and run NodeMailer, but It does not work. I wanted to send email from Gmail, thus, I enabled the "less secured" apps and also enabled captcha as suggested in the documentation of Nodemailer. However, even though I did this I could not make it work.
In addition, I tried to switch to my University's email, so I found its SMTP server and Port and configured the settings. The error persisted, mainly:
(node:825) UnhandledPromiseRejectionWarning: Unhandled promise rejection
(rejection id: 1): Error: connect EAGAIN 134.91.56.35:587 - Local (0.0.0.0:58442)
(node:825) [DEP0018] DeprecationWarning: Unhandled promise rejections are
deprecated. In the future, promise rejections that are not handled will
terminate the Node.js process with a non-zero exit code.
I am not exactly sure how to fix it, so I tried the next client, EmailJs. The error there is:
{ Error: connection encountered an error (connect EAGAIN 134.91.56.35:587 ...
code: 5,
previous: ...
... smtp: undefied}
I can clearly see that it is written that smtp is undefined, but I have verified that it is the same.
To clarify, I am running NodeJs on Bash on Windows, but since I know there are some issues with it I also run the code on a Raspberry PI 3.
Thank you!