Resend "You can only send testing emails to your own email address": the fix and the security check
Resend returns an error like: You can only send testing emails to your own email address What it means Your request is using Resend's testing setup. In that mode you can only send to your own account email. To s
Resend returns an error like:
You can only send testing emails to your own email address
What it means
Your request is using Resend's testing setup. In that mode you can only send to your own account email. To send to other people, you need a sending domain you own and have verified with Resend.
How to fix it
- Confirm the From address. If it uses the shared testing sender, that is the cause.
- Add and verify your own domain in Resend, following Resend's current DNS steps.
- Change the From address on your server to an address at that domain, for example
[email protected]. - Send a test to an address that is not yours.
Keep the key on the server
The Resend API key must be used only in server code. If a frontend call to Resend is the reason you hit this error, do not "fix" it by moving more of that logic into the browser. Anything with VITE_ or NEXT_PUBLIC_ in its name ends up in public JavaScript.
Protect the endpoint
If your app has a route that sends email, require login or rate limits on it. An open send route lets strangers send mail from your domain, which damages your sender reputation and can get the domain blocked.
Check it works
Send to a normal external address, then try calling your send route without being signed in. It should refuse.
Same steps with the FAQ: https://proofforge.live/errors/resend-testing-emails-only . To see whether your live app exposes keys or open routes, run the free outside check at https://proofforge.live
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.