Verification Email Not Being Sent

I’m hitting the POST /api/v2/users endpoint in my code, with a user object containing email_verified: false and the user’s email address is not receiving a verification email. I’m trying to use the email connection with passwordless login, so the user object also has connection: "email".

Here are the facts:

When I use Auth0’s email service, the email gets sent. When I use the settings for my smtp server, it does not. BUT! when I send a test email using the same settings, to the same email address as is used in the code, the email does deliver. Also, after hitting the endpoint, the logs show no errors, but my smtp server shows no attempt to deliver an email.

Am I mistaken that creating a user with email_verified: false should send an email to the user’s address for verification? Or is there somewhere else I should be looking for issues? Or is there something I’m missing about using the email connection?

Thanks for your time!

Hi @sgouch1, are you using Office 365 per chance as your tenant email provider? I have seen issues in the past with 365 not allowing emails to be sent when the “from” address does not match the credentials used to authenticate with the mail server.

If not, if you filter for “Failed Sending Notification” in your tenant logs do you see anything? There might be a hint there.

2 Likes

No Office 365 here, I’m using Mailjet.

And no sign of any “Failed Sending Notification” in the tenant logs :frowning:

Could it be that the sender of the real verification emails is different from the sender of the test emails? Mailjet seems to be really strict when it comes to authorized domains and sender addresses.

Yes the test email will be using its own template and thus a different from address, so that could well be the issue. I would recommend double checking your email connection’s template, (found by clicking on the email box here), and your allowed senders in Mailjet to check the from address being used by the email connection template is indeed allowed.

You could also configure a test email provider to remove Mailjet from the equation temporarily and check what is coming through:

2 Likes

Woohoo! The email connection’s template was still set to be from root@auth0.com, so Mailjet wasn’t happy. Just tested it out and it worked.

Thank you so much!!!

2 Likes

Thanks for helping on this one Steve and glad you have it working @sgcouch1 !