Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Self-host - Cannot send emails #76

Closed
scag1io opened this issue Apr 29, 2021 · 5 comments
Closed

Self-host - Cannot send emails #76

scag1io opened this issue Apr 29, 2021 · 5 comments
Labels
documentation Improvements or additions to documentation

Comments

@scag1io
Copy link

scag1io commented Apr 29, 2021

With the Cusdis hosted service I successfully receive the emails, but I can't figure it out on the self-hosted version.

I cloned the repository and deployed it on my vercel App. I set the environment variables:
SMTP_HOST set to "smtp.gmail.com"
SMTP_USER set to "my-email@gmail.com"
SMTP_PASSWORD set to an App password by Gmail
SMTP_SENDER set to "my-email@gmail.com"
SMTP_PORT set to 587
SMTP_SECURE set to "true"
then I redeployed the App.

I tested the server/user/psw with a SMTP tester and it works.
When I post a comment on my site, no email is received. I am also pretty sure that the request did not arrive to Google because the "last use date/time" of the App password did not change.

I also tried with Office365 SMTP and I did not receive any email. I tried port 465 too with no luck.
A doubt: SMTP_SECURE=true is related to SSL or TLS?
Also, what about the HOST env variable? What should be its value? My blog's URL, "my-blog.com"?

@frostming
Copy link
Contributor

SMTP_PORT set to 587

This should be 465. Other settings are correct

@scag1io
Copy link
Author

scag1io commented Apr 30, 2021

You are right, with port 465 it works! I think that was the only option I didn't try 🙄
I noticed that HOST is the same as NEXTAUTH_URL. Is it the same for you? Maybe only one variable could be used to simplify the configuration? Otherwise we can close the case.

@frostming
Copy link
Contributor

Yes, I also missed to configure HOST. Since NEXTAUTH_URL is required by next-auth, I guess we can discard HOST? /cc @djyde

@djyde
Copy link
Owner

djyde commented Apr 30, 2021

We really need a documentation page for how to setup each email provider (qq mail, gmail, foxmial, etc)

@djyde djyde added the documentation Improvements or additions to documentation label May 1, 2021
@djyde
Copy link
Owner

djyde commented May 8, 2021

ref #92

@djyde djyde closed this as completed May 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants