Build composable mail messages
Switch branches/tags
Clone or download
kalys and bcardarella Add installation instructions (#81)
It's not obvious that ```mail``` hex-package is connected with this repository
Latest commit 7c16c30 Aug 4, 2018

Mail Build Status

An RFC2822 implementation in Elixir, built for composability.

Mail is built and maintained by DockYard, contact us for expert Elixir and Phoenix consulting.


def deps do
  # Get from hex
  [{:mail, "~> 0.2"}]
  # Or use the latest from master
  [{:mail, github: "DockYard/elixir-mail"}]


You can quickly build an RFC2822 spec compliant message.


message =
  |> Mail.put_text("A great message")
  |> Mail.put_to("")
  |> Mail.put_from("")
  |> Mail.put_subject("Open me")


message = 
  |> Mail.put_text("Hello there!")
  |> Mail.put_html("<h1>Hello there!</h1>")
  |> Mail.put_attachment("path/to/")
  |> Mail.put_attachment({"", file_data})


After you have built your message you can render it:

rendered_message = Mail.Renderers.RFC2822.render(message)


If you'd like to parse an already rendered message back into a data model:


There are more functions described in the docs


We are very thankful for the many contributors


This library follows Semantic Versioning

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?

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


Licensed under the MIT license