#Express.js email verification

20 messages · Page 1 of 1 (latest)

wet breach
#

How can I implement sending emails in my express.js API ?
I want send email when user registers and I want to generate link to confirm email

Should I use SMTP? What is the best method?

untold pecan
#

Yes. That is the best option. Some email service providers also offer rest api or a client library. So let that be up to who you use for that.

wet breach
#

What if i want to use e-mail on my hosting?

#

I bought server, i can host Node js apps, create emails etc

#

how should i implement it?

untold pecan
#

@wet breach do not attempt to host smtp yourself. It's an extremely long, slow and tedious process. Every provider will blacklist you for spam. It's a mess

#

If your hosting provider offers mail, that's good. Nodemailer and go.

wet breach
#

yes, i mean email on my hosting

#

i can create email

#

how should I create confirmation link?

#

and how long should I store it?

untold pecan
#

This way you don't need to store it

wet breach
#

So generate jwt for link?

#

And put jwt in link?

#

How can i set expiration?

untold pecan
#

@wet breach yep. jwt has a field for that.

#

iat for issue time and exp for expiration

#

The library has an option for it too

wet breach
#

ok thanks