Quickstart: Send Your First Email





Send an email in under two minutes using your sandbox domain
Step 1: Sign up
- Sign up for Mailgun (free)
After creating your account, follow the guided setup in your Mailgun Dashboard to activate your account and create your first API key. Both of these things will need to be done during this setup in order for you to continue. You can then choose to continue with the dashboards guide to quickly send your first email, or you can grab your API key and continue below.
- Go to API Keys in your dashboard
- Copy your Private API key
Step 2: Add Authorized Recipient
First, add your email as an authorized recipient. This will send a verification email to that address.
curl -X POST \
"https://api.mailgun.net/v5/sandbox/auth_recipients?email=your-email@example.com" \
--user 'api:YOUR_API_KEY'
Check the authorized recipients email inbox and click the verification link before proceeding to Step 2B. You must verify your email address to receive emails from this sandbox domain.
Step 3: Send Your First Email
Once you've clicked the verification link in your email, you can now send an email to that recipient.
curl --user 'api:YOUR_API_KEY' \
https://api.mailgun.net/v3/YOUR_SANDBOX_DOMAIN/messages \
-F from='Test <postmaster@YOUR_SANDBOX_DOMAIN>' \
-F to='your-email@example.com' \
-F subject='Hello!' \
-F text='Test message'
You're response will look like
200 ok { "id": "message-id@your-domain.com", "message": "Queued. Thank you." }
Step 4: Check Your Inbox
- Check your inbox - email should arrive in seconds
- Didn't get it? Check spam folder or view logs
🎉 That's it! You just sent an email through Mailgun.
Step 5: Get production ready
Now that you've sent your first email, here's how to level up:
Set up your own domain
Move from sandbox to your custom domain..
Domain verification guide
DNS setup and verification process.
Send more email
Send to multiple people
Batch sending with personalization variables.
Use HTML templates
Create beautiful, branded emails.
Track opens & clicks
Monitor engagement with detailed analytics.