Jump to content

Node.js send email without an actual email

wasab
Go to solution Solved by 0x21,

https://www.mailgun.com/ will give you 10,000 free emails per month, so I'd suggest starting there.

So I am coding a node.js app that's going to handle registration of a new user account. When user submits his email, password, name, my node.js server will check the new email and username against the database to make sure it doesn't already exist and then send out a verification token (or verification code, whatever it is called) to the new user's email address to make sure the email is valid. 

 

I ran into issues at sending email. I tried using nodemailer but it seems to require me to provide a user name and password from a valid email address. I don't want to do that. Can I just make up a fake email address and then directly send the verification token to the new user's email over smtp? 

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

12 minutes ago, WWicket said:

I think you can use the sendmail transport to send without auth. 

https://nodemailer.com/transports/sendmail/

Many email-providers simply drop any email coming from random transport-agents, so that's not a particularly reliable way to handle user-registrations. It takes a good while to get a new email-server/-agent into the whitelist.

Hand, n. A singular instrument worn at the end of the human arm and commonly thrust into somebody’s pocket.

Link to comment
Share on other sites

Link to post
Share on other sites

4 hours ago, WereCatf said:

Many email-providers simply drop any email coming from random transport-agents, so that's not a particularly reliable way to handle user-registrations. It takes a good while to get a new email-server/-agent into the whitelist.

That's the main issue here. If you have and invalid provider or any bad X400 message it simply get dropped before even hitting the spam filter. I often deal with this. Usually if the person that is supposed to received the email send an email to the person that is being blocked it get whitelisted by most systems automatically, but you need an actual address to be actually whitelisted.

Link to comment
Share on other sites

Link to post
Share on other sites

On 9/26/2019 at 8:00 AM, Serjeant said:

https://www.mailgun.com/ will give you 10,000 free emails per month, so I'd suggest starting there.

I guess it is the next best thing to a fake email. 

 

Edit: you can remove the auth tag from nodemamil transport and replace it with local Host. It works very well. 

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×