Skip to main content
This guides utilizes an open source library contributed by a community member. It’s not developed, maintained, or supported by Emailr directly.

Prerequisites

To get the most out of this guide, you’ll need to:

1. Install

Install by adding emailr to your list of dependencies in mix.exs:
def deps do
  [
    {:emailr, "~> 0.4.0"}
  ]
end

2. Send email using HTML

The easiest way to send an email is by using the html parameter.
send.exs
client = Emailr.client(api_key: System.get_env("EMAILR_API_KEY"))

Emailr.Emails.send(client, %{
  from: "Acme <[email protected]>",
  to: ["[email protected]"],
  subject: "hello world",
  html: "<strong>it works!</strong>"
})

3. Try it yourself

Elixir Example

See the full source code.