DockYard/elixir-mail
{ "createdAt": "2016-02-09T16:43:15Z", "defaultBranch": "master", "description": "Build composable mail messages", "fullName": "DockYard/elixir-mail", "homepage": null, "language": "Elixir", "name": "elixir-mail", "pushedAt": "2025-10-10T18:26:03Z", "stargazersCount": 477, "topics": [ "elixir", "mail", "rfc-2822" ], "updatedAt": "2025-11-08T14:54:23Z", "url": "https://github.com/DockYard/elixir-mail"}An RFC2822 implementation in Elixir, built for composability.
Mail is built and maintained by DockYard, contact us for expert Elixir and Phoenix consulting.
Installation
Section titled “Installation”def deps do [ # Get from hex {:mail, "~> 0.4"},
# Or use the latest from master {:mail, github: "DockYard/elixir-mail"} ]endBuilding
Section titled “Building”You can quickly build an RFC2822 spec compliant message.
Single-Part
Section titled “Single-Part”message = Mail.build() |> Mail.put_text("A great message") |> Mail.put_to("bob@example.com") |> Mail.put_from("me@example.com") |> Mail.put_subject("Open me")Multi-Part
Section titled “Multi-Part”message = Mail.build_multipart() |> Mail.put_text("Hello there!") |> Mail.put_html("<h1>Hello there!</h1>") |> Mail.put_attachment("path/to/README.md") |> Mail.put_attachment({"README.md", file_data})Rendering
Section titled “Rendering”After you have built your message you can render it:
rendered_message = Mail.render(message)Parsing
Section titled “Parsing”If you’d like to parse an already rendered message back into a data model:
%Mail.Message{} = message = Mail.parse(rendered_message)There are more functions described in the docs
Authors
Section titled “Authors”We are very thankful for the many contributors
Versioning
Section titled “Versioning”This library follows Semantic Versioning
Looking for help with your Elixir project?
Section titled “Looking for help with your Elixir project?”At DockYard we are ready to help you build your next Elixir project. We have a unique expertise in Elixir and Phoenix development that is unmatched. Get in touch!
At DockYard we love Elixir! You can read our Elixir blog posts or come visit us at The Boston Elixir Meetup that we organize.
Want to help?
Section titled “Want to help?”Please do! We are always looking to improve this library. Please see our Contribution Guidelines on how to properly submit issues and pull requests.
DockYard, Inc. © 2015