Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Build composable mail messages

NotificationsYou must be signed in to change notification settings

DockYard/elixir-mail

Repository files navigation

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

defdepsdo[# Get from hex{:mail,"~> 0.4"},# 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("bob@example.com")|>Mail.put_from("me@example.com")|>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.render(message)

Parsing

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

%Mail.Message{}=message=Mail.parse(rendered_message)

There are more functions described in the docs

Authors

We are very thankful for the many contributors

Versioning

This library followsSemantic 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 expertisein Elixir and Phoenix development that is unmatched.Get in touch!

At DockYard we love Elixir! You canread our Elixir blog postsor come visit us atThe Boston Elixir Meetup that we organize.

Want to help?

Please do! We are always looking to improve this library. Please see ourContribution Guidelineson how to properly submit issues and pull requests.

Legal

DockYard, Inc. © 2015

@dockyard

Licensed under the MIT license


[8]ページ先頭

©2009-2025 Movatter.jp