Allow custom transports for nodemailer #4145
Replies: 3 comments
-
I would also very much like to see this implemented, but my timeline probably doesn't have enough room to wait for a community/ @nextauthjs org solution. @alfonsodev by any chance have you already implemented this in a fork or anything? There are lots of great reasons to use something other than SMTP. Some mail services don't even offer SMTP. Perhaps you want to log transactional emails like these, so you already have an API for transactional email sending that you want to make use of. Seems like something that would be very beneficial to add. |
Beta Was this translation helpful? Give feedback.
-
How's this looking? Has anyone contributed to implement this yet? |
Beta Was this translation helpful? Give feedback.
-
I'm not sure if it's expected, but this would work today, EXCEPT that there's a bug in the core/auth provider that expects attributes that only the SMTP transport provides. This is a very tricky thing to build a public & reproducible test case for, and I don't have the time to do it (I've already spent enough time on this!! ;-) ), but this (automatically closed) bug report details the issue and the fix/workaround: For reference, the following code snippet (modulo the omitted html() and text() functions) is a functional implementation using the nodemailer mailgun transport.
Hopefully that's useful to someone! Just in case anyone comes looking for the error message:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description 📓
Many email providers recommend using their APIs instead of SMTP,
Nodemailer allows to use custom transports and there are plenty already implemented,
for example nodemailer-sendgrid-transport.
This is how I was expecting it would work:
How to reproduce ☕️
does not apply
Contributing 🙌🏽
Yes, I am willing to help implement this feature in a PR
Beta Was this translation helpful? Give feedback.
All reactions