I'm working on an app and I'm using nodemailer to send recovery emails for users to reset their passwords and I'm trying to send a link to a page that will allow them to change their password. I'm using the following for the body of the email
html: '<p>Click <a href="localhost:3000/sessions/recover/' + recovery_token + '">here</a> to reset your password</p>'
But when I test it I just get an email with the text and no link, using the ispector shows <a>here</a>
, so it is sending the a tags, its just not sending the href.
SMTP is the main transport in Nodemailer for delivering messages. SMTP is also the protocol used between different email hosts, so its truly universal. Almost every email delivery provider supports SMTP based sending, even if they mainly push their API based sending.
The default value is 100 which means that once a connection is used to send 100 messages it is removed from the pool and a new connection is created. Set maxConnections to whatever your system can handle.
Once less secure apps is enabled now nodemailer can use your gmail for sending the emails.
I figured out the answer after I typed this question, so I guess I'll just answer my own question in case anyone else has the problem. I needed to include the http://
in the email, when I changed the body of the email to
html: '<p>Click <a href="http://localhost:3000/sessions/recover/' + recovery_token + '">here</a> to reset your password</p>'
it started working.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With