Email provider with insecure SMTP for local testing/development #2184
-
Question 💬I am using Next Auth and am trying to setup the email sign in flow. However for my local development, I am using a local SMTP server so I can catch all emails being sent out. (Specifically MailDev) However I am getting the following error message:
I do not see any documentation about specifying an unsecure connection. The closest related issue I could find is #807. I tried setting the Steps to reproduce
Here is my provider config: Providers.Email({
server: {
host: process.env.EMAIL_SERVER_HOST,
port: parseInt(process.env.EMAIL_SERVER_PORT),
auth: {
user: process.env.EMAIL_SERVER_USER,
pass: process.env.EMAIL_SERVER_PASSWORD
},
secure: false
},
from: process.env.EMAIL_FROM
}), |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
So found the solution, had to add the following to the server config: tls: {
rejectUnauthorized: false
} Found from https://nodemailer.com/smtp/#3-allow-self-signed-certificates |
Beta Was this translation helpful? Give feedback.
So found the solution, had to add the following to the server config:
Found from https://nodemailer.com/smtp/#3-allow-self-signed-certificates