Skip to content

Email for Lovable apps

Give your Lovable app real email on your own domain: welcome mails and receipts through a Supabase edge function, a contact form that lands in your inbox, and a mailbox that catches the replies. Paste one prompt.

Updated

Before you start

  1. Add your domain in Mektup and the DNS records it shows.
  2. Create an API key (Dashboard, API keys) and add it to your project's secrets as MEKTUP_API_KEY.
  3. For a contact form, create a form under Forms and copy its access key.

The prompt

Paste into Lovable
Add email to this app with Mektup (https://usemektup.com).

1. Create a Supabase edge function "send-email" that receives { to, subject, text }
   and POSTs it to https://api.usemektup.com/v1/emails with the header
   "Authorization: Bearer " + MEKTUP_API_KEY and the body
   { from: "hello@<our domain>", to, subject, text }.
   Read MEKTUP_API_KEY from the function's secrets. Never put it in frontend code.
2. Use that function for welcome emails and order confirmations.
3. Make the contact form POST to https://api.usemektup.com/submit with a hidden
   field access_key = "<our Mektup form key>" and fields name, email, message.
   Show a success message when the JSON response has success: true.

Sign-up and password emails

Auth emails come from Supabase itself. Point Supabase at Mektup as custom SMTP so they leave from your domain without the 2-an-hour limit: the settings.

Questions

Can a Lovable app send email?

Yes, from its backend: a Supabase edge function (Lovable Cloud) calls an email API with a secret key. Mektup's API sends from your own domain, and the replies arrive in a real mailbox.

How do I add a contact form to a Lovable site?

Have the form post to https://api.usemektup.com/submit with your form's access key. Submissions arrive in your Mektup mailbox with Reply-To set to the visitor. The access key is public, so it can live in the frontend.

Can Lovable use Mektup through MCP?

Lovable can connect to remote MCP servers. Add https://mcp.usemektup.com/mcp and sign in with your Mektup account, and Lovable's agent can create mailboxes, read the DNS records and send test mail itself.

Do I need a domain?

Yes. Mektup sends from and receives on a domain you own. Connect it once in Mektup and add the DNS records it shows.

Start today, or talk to us?

Starter is $20 a month. Agencies get a quote for every client domain on one account.