Send email from your own domain with Mailgun
Connect your Mailgun account so invitations, reminders and every other email to participants come from your own domain, with delivery, open and bounce statuses back in Polzy.
On this page
By default, Polzy sends email from its own shared account. Connect your Mailgun account and every email this workspace sends to participants — campaign invitations and reminders, thank-you and event emails, workflow emails and replies in a conversation — goes out through Mailgun, from an address on your own domain. People see a sender they recognise, and your domain's reputation is your own.
Your own email sender is on Team and up, and only Admins can connect it. On Team you connect it under Messages → Integrations; on Business and up, also on the Integrations page.
Before you start
You need:
- A workspace on Team or higher, and the Admin role in it.
- A Mailgun account, with the right to add a domain and create an API key.
- Access to your domain's DNS, to add the records Mailgun gives you.
- To know whether your Mailgun account is in the US or the EU region.
How Polzy uses Mailgun
- All participant email. Once you choose Mailgun for email, every email the workspace sends to participants goes through it. Polzy's own email — sign-in links, password resets, invoices — still comes from Polzy.
- Who it is from. The From Email you enter. The name set under Settings → Branding (Sender name) takes precedence over the From Name entered here. Mailgun emails from Polzy carry no separate reply-to address, so replies go to the From Email.
- What it looks like. Nothing changes: emails keep your workspace's logo and colour.
- What it costs. Mailgun bills you for these emails. They do not count against your organization's monthly emails in Polzy.
- What comes back. With webhooks in Mailgun, each message's log shows whether it was delivered, opened, clicked or bounced.
Step 1: Verify your domain in Mailgun
Mail providers such as Gmail and Outlook trust an email when the domain it comes from says the sender may use it. Three DNS records do that: SPF names the servers allowed to send for your domain, DKIM signs each message so it cannot be altered, and DMARC tells receivers what to do when a message fails both. Mailgun gives you the first two; you add the third.
- In Mailgun, add your sending domain. A subdomain, such as
mg.acme.com, keeps your main domain's email unaffected. - Add the records Mailgun shows at your DNS host: a TXT record for SPF (
v=spf1 include:mailgun.org ~all), a TXT record for DKIM, a CNAME record for open and click tracking, and two MX records if you will receive replies. - Click Verify DNS settings in the domain's settings, or wait for Mailgun to check. DNS changes can take 24 to 48 hours to be seen.
- Add a DMARC record: a TXT record at
_dmarcon your domain.v=DMARC1; p=none;is a safe start that changes nothing while you check your reports.
See Mailgun: Domain verification. Gmail requires SPF or DKIM from every sender, and DMARC as well from anyone sending more than 5,000 messages a day: see Google: Email sender guidelines.
Step 2: Create an API key
- In Mailgun, open Account Settings, then API keys, and click Create key.
- Copy the key and keep it safe: Mailgun may not show it again.
Use an account API key, not a domain sending key. Polzy reads your domain's details when you connect, to check that the domain exists in your account, and a sending key is only allowed to send.
See Mailgun: API key management.
Step 3: Connect Mailgun in Polzy
- Open the place to connect it:
- On Team: Messages, then the Integrations tab. Under Providers, find Mailgun and click Set up.
- On Business and up: Integrations in the sidebar, the Available tab, then Connect on Mailgun's row.
- In the Connect Mailgun panel, fill in the fields:
| Field | What to enter |
|---|---|
| Mailgun API Key | The key from step 2. Required. |
| Mailgun Domain | Your verified sending domain, exactly as it is in Mailgun, such as mg.acme.com. Required. |
| Region | US or EU: where your Mailgun account and domain are. Required; US to start with. |
| From Email | The address emails come from, on your sending domain. Required. |
| From Name | The name people see, such as Acme People Team. Optional; Sender name under Settings → Branding takes precedence. |
| Webhook signing key | Leave it empty for now: you get it in step 5. |
- Click Test connection. You should see Successfully connected to Mailgun domain: and your domain.
- Click Connect.
Step 4: Choose Mailgun for email
Connecting Mailgun does not switch your email over yet. Choose it once for the workspace:
- Open Settings, then the Notifications tab, and scroll to Channels.
- On the Email row, change Polzy · shared account to Mailgun.
- Make sure the switch on the row is on.
From now on every email the workspace sends goes through Mailgun.
Step 5: Get delivery statuses back
Without this step, emails still go out, but their log stops at Sent. With it, Polzy learns from Mailgun what happened to each one.
The address Mailgun reports to is shown on Mailgun's own page, which opens from the Integrations page on Business and up. On Team that page is not available, so emails are sent and their log stays at Sent.
- In Polzy, open Integrations, click Mailgun's row to open its page, and find Receiving. Copy the address shown there.
- In Mailgun, open your domain's webhooks and add the address for the delivered, opened, clicked, permanent failure, temporary failure and spam complaint events.
- In Mailgun, open Settings → API Security and copy the HTTP webhook signing key. It is a different key from your API key.
- In Polzy, click Configure on Mailgun, paste it into Webhook signing key and click Save.
Without the signing key, Polzy refuses every event from Mailgun as unsigned, and the Activity section of Mailgun's page shows Incoming message refused. See Mailgun: Introduction to webhooks and Mailgun: Securing webhooks.
Opened and Clicked appear only when open and click tracking is on for the domain in Mailgun. A permanent failure or a spam complaint marks the message Bounced, and Polzy stops emailing that address from this workspace. A temporary failure leaves it at Sent while Mailgun keeps trying.
Replies. Emails Mailgun sends for Polzy carry no separate reply-to address, so every reply goes to your From Email — replies in a Polzy conversation included — and not to the conversation in Polzy. To bring them in, receive that address's domain in Mailgun and forward it to the same address with a route (the Receiving tab in Mailgun, with a forward action to the address): a reply from someone with an open email conversation is then added to that conversation. See Mailgun: Routes.
Test it
Send a small campaign with only yourself in the audience (see Send a survey with a campaign). Then open Messages: your email should move from Sent to Delivered, and to Opened when you open it. Open the email's details in your mail app to check that SPF, DKIM and DMARC say pass.
Troubleshooting
| What you see | Why, and what to do |
|---|---|
| Request failed with status code 401 | Mailgun refused the key: it was mistyped, deleted, or it is a domain sending key. Use an account API key (step 2). |
| Request failed with status code 404 | Mailgun does not know the domain at that address: check Mailgun Domain for typos, and set Region to where the domain is — an EU domain needs EU. |
| Mailgun Domain is required, From Email must be a valid email address | A required field is empty or mistyped. |
| Emails still come from Polzy | Settings → Notifications → Channels still says Polzy · shared account on the Email row (step 4), or Mailgun needs attention. |
| Statuses never move past Sent | The webhooks are missing, or Webhook signing key is empty, wrong, or is your API key. The Activity section of Mailgun's page in Polzy shows Incoming message refused with the reason. |
| Emails land in spam | Check that SPF, DKIM and DMARC pass, and that the From Email is on your sending domain. |
Good to know
- If Mailgun stops working, Polzy keeps trying it, because the next attempt may work, and marks it Needs attention. If you disconnect it, or your plan no longer includes your own email sender, email goes back to Polzy's shared account and counts against your monthly emails again.
- One email sender at a time. The Email row takes one provider. You can connect another to have it ready, and switch on the row.
- Conversations. Without a route, a reply to a conversation email lands in the From Email mailbox under the person's own address — for an anonymous follow-up too, so whoever reads that mailbox sees who wrote. If your workspace uses conversations, Resend or Polzy's shared account keeps replies inside Polzy.
- Reply-to address. The Reply-to address under Settings → Branding is not used with Mailgun.
- What Polzy keeps. The API key and the signing key are stored encrypted and never shown again.
Useful links
Related articles
Signed-in members can ask Polzy or message the team from Support. How fast we reply depends on your plan.