This example shows how to use Mailtrap Email Sending API with Supabase Edge Functions.
- Copy
.env.exampleto.envand add your Mailtrap API key. - Important: Supabase Edge Functions do not use .env after deployment.
You must also store your API key as a Supabase secret:
supabase secrets set MAILTRAP_API_KEY=your_mailtrap_api_key - Make sure the
from.emailinindex.tsbelongs to a verified Sending Domain in your Mailtrap account. - Deploy with Supabase CLI:
supabase functions deploy mailtrap --no-verify-jwt - Call the function:
curl https://<your-ref>.supabase.co/functions/v1/mailtrap
- supabase/functions/mailtrap/index.ts
- .env.example
- README.md