Code Monkey home page Code Monkey logo

elixir-mail's Introduction

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.

Installation

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

Building

You can quickly build an RFC2822 spec compliant message.

Single-Part

message =
  Mail.build()
  |> Mail.put_text("A great message")
  |> Mail.put_to("[email protected]")
  |> Mail.put_from("[email protected]")
  |> Mail.put_subject("Open me")

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

After you have built your message you can render it:

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

Parsing

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

Mail.Parsers.RFC2822.parse(rendered_message)

There are more functions described in the docs

Authors

We are very thankful for the many contributors

Versioning

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.

Legal

DockYard, Inc. © 2015

@dockyard

Licensed under the MIT license

elixir-mail's People

Contributors

andrewtimberlake avatar bcardarella avatar bjfish avatar daniel-xu avatar danxexe avatar fire-dragon-dol avatar icedragon200 avatar iwarshak avatar kalys avatar koleksiuk avatar kovus avatar nitrino avatar princemaple avatar rgreenjr avatar rgtjr avatar serpent213 avatar shribe avatar trevoke avatar veverkap avatar

Watchers

 avatar

Forkers

brusai

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.