> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neoagent.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Mailgun

> Send email from your own domain through Mailgun, and check what was delivered, bounced or blocked

Mailgun is an email delivery service: you verify your own sending domains there, and Mailgun sends, tracks and receives mail for them. Connect your Mailgun account once with an API key, and Neo agents send their emails from your domain, with your name and address, rather than from Neo's.

## What Neo can do with Mailgun

* Send an email from your verified Mailgun domain, as plain text, HTML or a template stored in Mailgun filled with the ticket's details, with CC, Reply-To, tags and attachments
* Check whether an email was delivered, failed, opened or bounced, from Mailgun's delivery events and logs
* Find why mail to an address is blocked (a bounce, an unsubscribe or a spam complaint) and remove the address once the cause is fixed
* Manage mailing list members, such as adding a new starter or removing a leaver
* Read a domain's DNS records and verification, sending stats, inbound routes, webhooks, SMTP logins and IPs, and change them with the approvals your access profile sets

## When to use Mailgun and when Send Email

[Send Email](https://docs.neoagent.io/agents/tools/communication/send-email.md) sends from Neo's own address and needs no setup. Use Mailgun when the email must come from your own domain, such as a message to a client's users signed as your service desk. Say which one in the agent's instructions.

## Example instructions

```
When a ticket is resolved, email the ticket's contact through Mailgun from
"Contoso IT Support <support@mg.contoso-it.com>", with Reply-To support@contoso-it.com,
using the Mailgun template "ticket-resolved" with the ticket number and title.
Then check that Mailgun delivered it, and add an internal note with the result.
```

See [Mailgun API](https://docs.neoagent.io/agents/tools/communication/mailgun-api.md) for the permission groups.

## Next steps

> [card] [Connect Mailgun](https://docs.neoagent.io/integrations/mailgun/connecting-to-neo.md)
>
> Make a Mailgun API key and save it in Neo.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.