1. Create the sending mailbox
In Mektup, add your domain and its DNS records, then create a mailbox such as auth@yourapp.com. Keep the password it shows: that is the SMTP password.
2. Add it to Supabase
In the Supabase dashboard open Authentication, then Emails, then SMTP Settings, turn on custom SMTP and enter:
Sender email auth@yourapp.com
Sender name Your App
Host mail.usemektup.com
Port number 465
Username auth@yourapp.com
Password the mailbox password from MektupThen raise the limit under Authentication, Rate Limits: custom SMTP starts at 30 emails an hour.
3. Email from your own code
For emails outside Auth, such as receipts or notifications, call the Mektup API from an edge function. Store the key as a secret, never in the browser:
supabase secrets set MEKTUP_API_KEY=mek_live_...// supabase/functions/send-email/index.ts
Deno.serve(async (req) => {
const { to, subject, text } = await req.json();
const res = await fetch("https://api.usemektup.com/v1/emails", {
method: "POST",
headers: {
Authorization: `Bearer ${Deno.env.get("MEKTUP_API_KEY")}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ from: "hello@yourapp.com", to, subject, text }),
});
return new Response(await res.text(), { status: res.status, headers: { "Content-Type": "application/json" } });
});Receiving mail in Supabase
Set a Mektup mailbox webhook to another edge function, and every email to, say, support@yourapp.com arrives in your function as JSON, ready to write to a table. The webhook format and signature check.