Features more features

Built For Developers

Control everything through intuitive, RESTful APIs.

  • Fast and simple HTTP API or SMTP interface.
  • Server-side MIME assembly. No libraries required.
  • Live logs and webhook event notifications.
  • Everything is built and priced to scale with you.

Let us worry about the headaches of managing an email server.

Optimized Deliverability

Get emails delivered to inbox.

  • Processing of ESP feedback to optimize sending rates.
  • Clean IP addresses and whitelist registrations.
  • Proper authentication using SPF and DKIM.
  • Automated bounce, unsubscribe and complaint handling.

We provide the best infrastructure and deliverability expertise.

Receiving, Parsing & Storage

Real email servers, not just SMTP relay.

  • Create and manage mailboxes programmatically.
  • White label domains and spam filtering.
  • Routes to filter, parse and POST messages to your app.
  • Attachments, signatures and replies parsing.

Email is not just sending, use Mailgun to engage your users.

Track Everything

Analytics to measure and improve your performance.

  • Track clicks, opens, unsubscribes, bounces and complaints.
  • Create multiple campaigns with simple tagging.
  • Get notified of events in real time via HTTP.
  • Use with Mailing Lists for scalable newsletters.

More than enough data to impress any VP of Marketing.

Customers case studies

YC Uservoice Colorlovers FT everyblock

Developer Examples developer docs

  1. RestClient.post "https://api:key-3ax6xnjp29jd6fds4gc373sgvjxteol0" \
  2. "@api.mailgun.net/v2/samples.mailgun.org/messages",
  3. :from => "Excited User <me@samples.mailgun.org>",
  4. :to => "dude@mailgun.net, devs@mailgun.net",
  5. :subject => "Hello",
  6. :text => "Testing some Mailgun awesomeness!"
  1. requests.post(("https://api.mailgun.net/v2/samples.mailgun.org/messages"),
  2. auth=("api", "key-3ax6xnjp29jd6fds4gc373sgvjxteol0"),
  3. data={
  4. "from": "Excited User <me@samples.mailgun.org>",
  5. "to": ["dude@mailgun.net",
  6. "devs@mailgun.net"],
  7. "subject": "Hello",
  8. "text": "Testing some Mailgun awesomeness!"})
  1. $request = new HttpRequest('https://api.mailgun.net/v2/samples.mailgun.org/messages', HttpRequest::METH_POST);
  2. $auth = base64_encode('api:key-3ax6xnjp29jd6fds4gc373sgvjxteol0');
  3. $request->setHeaders(array('Authorization' => 'Basic '.$auth));
  4. $request->setPostFields(array('from' =>'Excited User <Excited User <me@samples.mailgun.org>',
  5. 'to' => 'dude@mailgun.net, devs@mailgun.net',
  6. 'subject' => 'Hello',
  7. 'text' => 'Testing some Mailgun awesomeness!'));
  8. $request->send();
  1. Client client = Client.create();
  2. client.addFilter(new HTTPBasicAuthFilter("api","key-3ax6xnjp29jd6fds4gc373sgvjxteol0"));
  3. WebResource webResource = client.resource("https://api.mailgun.net/v2/samples.mailgun.org/messages");
  4. MultivaluedMapImpl formData = new MultivaluedMapImpl();
  5. formData.add("from", "Excited User <me@samples.mailgun.org>");
  6. formData.add("to", "dude@mailgun.net");
  7. formData.add("to", "devs@mailgun.net");
  8. formData.add("subject", "Hello");
  9. formData.add("text", "Testing some Mailgun awesomeness!");
  10. webResource.type(MediaType.APPLICATION_FORM_URLENCODED).post(ClientResponse.class, formData);
  1. RestClient client = new RestClient();
  2. client.BaseUrl = "https://api.mailgun.net/v2";
  3. client.Authenticator = new HttpBasicAuthenticator("api", "key-3ax6xnjp29jd6fds4gc373sgvjxteol0");
  4. RestRequest request = new RestRequest();
  5. request.AddParameter("domain", "samples.mailgun.org", ParameterType.UrlSegment);
  6. request.Resource = "{domain}/messages";
  7. request.AddParameter("from", "Excited User <me@samples.mailgun.org>");
  8. request.AddParameter("to", "dude@mailgun.net");
  9. request.AddParameter("to", "devs@mailgun.net");
  10. request.AddParameter("subject", "Hello");
  11. request.AddParameter("text", "Testing some Mailgun awesomeness!");
  12. request.Method = Method.POST;
  13. client.Execute(request);
  1. curl -s -k --user api:key-3ax6xnjp29jd6fds4gc373sgvjxteol0 \
  2. https://api.mailgun.net/v2/samples.mailgun.org/messages \
  3. -F from='Excited User <me@samples.mailgun.org>' \
  4. -F to='Dude <dude@mailgun.net>'\
  5. -F to=devs@mailgun.net \
  6. -F subject='Hello' \
  7. -F text='Testing some Mailgun awesomeness!'

Your App with Email in Minutes

Our API makes integrating real Email quick & easy.