guileen / node-sendmail

send mail without setting up a SMTP server
http://guileen.github.com/node-sendmail
MIT License
559 stars 110 forks source link

How do I specify smtp authentication? #88

Closed getify closed 11 months ago

getify commented 2 years ago

I've used node-sendmail for sending emails locally from my server, and that's worked fine until recently, when my emails seem to get bounced more.

So I signed up for an SMTP sending service, and they provide me an SMTP server/port and a username/password, and recommended I configure my code to send through them.

I specified the smtpPort and smtpHost configurations... but how do I provide the authentication info? Is it auth: { user, pass } (as in nodemailer)?

I want to continue using this package so I don't have to change all my code to use a different library.

Juggern4ut commented 2 years ago

Any update on this? Is it already implemented or will it be in the future? Thanks for helping :)

getify commented 2 years ago

I found this code commented out in the source code:

https://github.com/guileen/node-sendmail/blob/f8f5666b13252e6e5940db59d8083fcf3a102047/sendmail.js#L165-L171

I think that definitively answers that this library doesn't support SMTP auth in its current form. Not sure if it will in the future. Unfortunately, I just had to switch my code to using nodemailer which works just fine. The conversion of the code was pretty straightforward.

Juggern4ut commented 2 years ago

Thanks for the help and quick reply. I also switched to nodemailer due to it's simplicity.