I have lite nodejs server. I am trying to implement password reset flow. I use nodemailer to send email with reset password link. I want to test if I send email properly. I don't want to use any remote smpt.
What I can use on my local environment to catch emails and check if they are good?
I used mailcatcher. It is a super simple SMTP server which catches any message sent to it to display in a web interface.
I have following configuration:
let smtpConfig = {
host: '127.0.0.1',
port: 1025,
secure: false, // upgrade later with STARTTLS
auth: {
user: 'user',
pass: 'password'
}
};
Do not forget to add user and password in auth section. It can be even white space. But it can't be empty string in this case you'll get error.
const smtpTransport = nodemailer.createTransport(smtpConfig);
And now you can see all sent emails here http://127.0.0.1:1080
Try this command:
python -m smtpd -n -c DebuggingServer localhost:1025
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