App Finishers

Fix guide · updated 2026-11-16

Supabase "Error sending recovery email"

AuthRetryableFetchError: Error sending recovery email · Error sending magic link email · 500

The password reset or the magic link button fails with Error sending recovery email or Error sending magic link email. Supabase tried to hand the email to your email provider and the provider said no, or never answered. The message doesn't say why, but Supabase's Auth log does. We ran Supabase's real Auth server against a test mail server that fails in each common way, with supabase-js 2.119, and wrote down what each failure looks like. Three surprises: a reset for an address with no account always "works", every failed attempt still counts against your hourly email limit, and a slow mail server can deliver an email whose link is already dead.

What the error means

Supabase Auth builds the email, connects to the SMTP server in your settings (Resend, Postmark, Brevo, Amazon SES…) and sends it. If any step fails, it answers with a 500 that only says which email failed:

500 {"code":"unexpected_failure","message":"Error sending recovery email"}

From curl, Postman or another language, without the version header supabase-js sends:

500 {"code":500,"error_code":"unexpected_failure","msg":"Error sending recovery email","error_id":"…"}

In supabase-js 2.119 it arrives as AuthRetryableFetchError with status 500, and error.code is undefined. The same failure gets a different name depending on the email Auth was sending. In our test, with the mail server refusing the password:

All of them have the same causes and the same fix. If you never set up your own email provider, read our guide to "Error sending confirmation email" first: Supabase's built-in email only sends to your team and refuses everyone else with "Email address not authorized".

1. Read the real reason in the Auth log

Supabase dashboard → Logs. Set Log Type to Auth and Level to error, then open the line for your request: path /recover for a password reset, /otp for a magic link. Under Raw JSON, the error field holds what the mail server answered. One of ours:

{"msg": "request completed", "path": "/recover", "status": 500,
 "error_code": "unexpected_failure",
 "error": "535 \"5.7.8 Authentication credentials invalid\"", …}

Find the start of your error field here. The number is a standard SMTP code. The words after it are your provider's own, so they're more precise than ours:

Change the settings under Authentication → SMTP Settings, save, and try again. There's no need to wait: a failed attempt doesn't start the 60-second wait between two emails to the same person.

2. Port 465 is the only TLS port Supabase knows

Auth's mail code turns on TLS from the first byte only when the port is exactly 465. On any other port it starts unencrypted and switches to encryption with STARTTLS. So:

3. "Processing this request timed out": the email may still arrive, with a dead link

When the mail server is slow or silent, Auth gives up after 10 seconds and answers:

504 {"code":"request_timeout","message":"Processing this request timed out, please retry after a moment."}

It doesn't stop the sending, though. Our test server waited 12 seconds before saying hello. The app got the 504 at 10 seconds, and the reset email still arrived two seconds later. Its link didn't work: Email link is invalid or has expired, because Auth had already given up and saved nothing for that link. So users who saw the error and then got the email anyway hit the expired-link error. Once your mail settings are fixed, they need to ask for a new email.

A wrong port (section 2), or a mail server that accepts the connection but doesn't answer, ends the same way.

4. Why it "works" when you test it

5. Failed attempts still use up your hourly email limit

With Confirm email on (the default), Supabase counts an email against the project's hourly limit before it tries to send it (30 an hour by default once you use your own SMTP). A failed send counts too. We set the limit to 3: two failed resets and one that worked used it up, and the next request got email rate limit exceeded without even trying the mail server. So after an afternoon of failures, users can stay blocked for the rest of the hour even though your settings are fixed. Raise the limit in Authentication → Rate Limits, or see our guide to "email rate limit exceeded".

6. Help a locked-out user right now

On your server, with the secret service-role key, auth.admin.generateLink() returns the link without sending any email. It worked in our test while the mail server was refusing everything:

const { data, error } = await supabaseAdmin.auth.admin.generateLink({
  type: 'recovery', // or 'magiclink'
  email: 'user@theirdomain.com',
})
// data.properties.action_link = the link the email would have contained

That link signs the person in, so only give it to someone you've confirmed owns the account. It's a stopgap while you fix the settings, not a way around them.

Show a message people understand

Check error.status, not error.code (it's empty for these errors in supabase-js 2.119):

const { error } = await supabase.auth.resetPasswordForEmail(email, { redirectTo })
if (error && (error.status === 500 || error.status === 504)) {
  setError("We couldn't send the email right now. Please try again in a few minutes.")
} else if (error) {
  setError(error.message)
} else {
  setNotice('If an account exists for this address, we sent a link.')
}

If an AI tool built your app

This error comes from the email settings in your Supabase dashboard, so no code change fixes it, and an AI tool that rewrites your login flow will make things worse. Fix the settings first (sections 1 and 2), then give your tool this prompt for the message:

When supabase.auth.resetPasswordForEmail or signInWithOtp returns an error with status 500 or 504 ("Error sending recovery email", "Error sending magic link email" or "Processing this request timed out"), show "We couldn't send the email right now. Please try again in a few minutes." instead of the raw message. Don't treat it as a network error and don't retry automatically. Don't change the sign-in flow or anything else.

Using a Send Email hook instead of SMTP?

Then you won't see these messages. Auth passes on what your hook said. In our test: a hook that answered 500 gave Unexpected status code returned from hook: 500, a hook that never answered gave Failed to reach hook after maximum retries (422, after 3 tries), and a hook that answered { "error": { "http_code": 400, "message": "…" } } passed its own message to the app. The reason is in your hook's logs, for example your Edge Function's logs.

Not quite your error?

Still stuck?

Put the same host, port, username and password into another email program, or your provider's own test tool. If it fails there too, the problem is at the provider: contact their support with the time of the failed request, and they can read the refusal in their own logs. If it works there and Supabase still fails, compare the Sender email and the port, the two settings other programs fill in for you.

Other Supabase problems? See Supabase fixes.