Mails not being sent (Mailgun and Sendgrid tested => both haven't even got an API request)
Hey, I have setup my main.wasp with my email I have registered and set the APIKey - for password reset I am getting 200 as return but no mail is ever being sent
7 Replies
Hi @Johnny. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
I'm sorry to hear that you're having trouble with sending emails. Here are a few things you can check:
1. Provider Setup: Make sure you have correctly set up the email provider in your
main.wasp
file. If you're using Mailgun, your setup should look like this:
If you're using SendGrid, replace Mailgun
with SendGrid
in the provider field.
2. API Key and Domain: Ensure that you have correctly added your Mailgun API key and domain to your .env.server
file. The file should look like this:
If you're using SendGrid, replace MAILGUN_API_KEY
and MAILGUN_DOMAIN
with your SendGrid API key and domain.
3. Email Address: Check if you have already logged in with the same email address using the Email
method. If so, run wasp db studio
and delete that user and try logging in again.
4. Check Logs: If you're using the Dummy
provider during development, it will console.log
the emails in the console instead of sending them. Check your console logs to see if the emails are being logged.
5. Check with Provider: If everything seems to be set up correctly, but emails are still not being sent, it might be worth checking with your email provider (Mailgun or SendGrid) to see if they have received any API requests.
If you're still having trouble, it might be helpful to look at the Wasp documentation on sending emails (https://wasp-lang.dev/docs/advanced/email) or ask for help in the Wasp Discord community (https://discord.com/channels/686873244791210014/1179895919471247490).
Sources:
- Wasp Documentation: Sending Emails (https://wasp-lang.dev/docs/advanced/email)
- Wasp Documentation: Using the Mailgun Provider (https://wasp-lang.dev/docs/advanced/email#using-the-mailgun-provider)
- Wasp Discord Community (https://discord.com/channels/686873244791210014/1179895919471247490)
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Johnny, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?Edit - found the issue - some error handling would maybe an idea
If the use has no email in the database he cant get a mail delivered
Edit 2: still getting no emails delivered
Wohooo @Johnny, you just became a Waspeteer level 1!
We need more information to be able to help you 🤷🏻♂️ what kind of app are you building? Are you using open saas? Did you use Mailgun or Sendgrid before successfully?
Sometimes you need to verify the sending domain and it might work only for your test email acc. That's want happened to me sometimes.
I switched from sendgrid/mailgun to a smtp server (hetzner)
I am using open saas
And trying to figure out how to get the mail sencind done
Manages to use it succesfully with my own application already
Could you share a bit of code? 🫡
set up
SMTP_HOST=mail.your-server.de
[email protected]
SMTP_PASSWORD=
SMTP_PORT=465
Could it be that password reset is not set up by default?
I have no clue what I am doing wrong tbh. 😄
And with "Dummy" I am only getting
And
Anyone an idea why SMTP isn't working?
Password, username etc. is correct
For anyone having simillar problems - solved it. It seems to only work with port 587 via hetzner (465 isn't)