Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Elixir
  3. mailgun

mailgun

MITElixir

An Elixir client library for sending emails via the Mailgun API with a clean, declarative interface.

GitHubGitHub
197 stars96 forks0 contributors

What is mailgun?

Mailgun is an Elixir client library that provides a clean interface for sending emails through the Mailgun email service API. It allows developers to integrate email functionality into their Elixir applications with minimal boilerplate code, handling API communication, attachments, and testing configurations automatically.

Target Audience

Elixir developers building applications that need reliable email delivery functionality, particularly those already using or considering the Mailgun email service.

Value Proposition

Developers choose this library for its declarative, Elixir-idiomatic API that reduces integration complexity while providing essential features like attachment handling and a built-in test mode that prevents accidental email sends during development.

Overview

Elixir Mailgun Client

Use Cases

Best For

  • Adding Mailgun email delivery to Elixir Phoenix applications
  • Sending transactional emails with attachments in Elixir
  • Testing email functionality without hitting the Mailgun API
  • Configuring custom HTTP timeouts for Mailgun API requests
  • Building reusable email modules in Elixir projects
  • Sending both HTML and plain text emails from Elixir code

Not Ideal For

  • Projects needing email delivery through multiple providers or services
  • Applications requiring advanced email templating or dynamic content generation
  • Teams preferring a pluggable email client architecture with adapter support
  • Environments where httpc's limitations in connection pooling or SSL are critical

Pros & Cons

Pros

Declarative Email API

The library offers a clean, function-based interface for sending emails, as shown in the README with examples like `send_email to: user.email, from: @from, subject: 'hello!'`, reducing boilerplate code.

Built-in Test Mode

It includes a test mode that redirects emails to a local JSON file, preventing accidental API calls during testing, configured via `mode: :test` and `test_file_path`.

Attachment Flexibility

Supports attachments via both file paths and raw content strings, demonstrated with `%{path: file_path}` for files and `%{content: pdf}` for in-memory data.

Custom HTTP Control

Allows fine-grained HTTP configuration through `httpc_opts`, enabling settings like timeouts, as seen in the example with `connect_timeout: 2000`.

Cons

Limited HTTP Client

Relies on Erlang's httpc, which may lack features like automatic retries or advanced pooling compared to modern Elixir HTTP clients, and is explicitly mentioned as the underlying mechanism.

Basic Test Integration

Test mode only outputs to a JSON file, which doesn't integrate with Elixir's testing frameworks for in-memory assertions or real-time inspection, limiting testing flexibility.

Early Development Stage

With version 0.1.2, the library is in early stages, potentially leading to breaking changes or missing features, as indicated by the low version number and minimal documentation.

Frequently Asked Questions

Quick Stats

Stars197
Forks96
Contributors0
Open Issues11
Last commit3 years ago
CreatedSince 2014

Tags

#elixir#attachments#email-client#testing-tools#email-delivery#hex-package

Built With

E
Elixir

Included in

Elixir13.1k
Auto-fetched 9 hours ago

Related Projects

google-cloudgoogle-cloud

Elixir client libraries for accessing Google APIs.

Stars1,081
Forks476
Last commit2 months ago
stripity_stripestripity_stripe

An Elixir Library for Stripe

Stars1,076
Forks379
Last commit23 hours ago
slackslack

Slack real time messaging and web API client in Elixir

Stars682
Forks183
Last commit2 years ago
pigeonpigeon

iOS and Android push notifications for Elixir

Stars679
Forks164
Last commit9 hours ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub