Elixir
Learn how to integrate Mailtrap with your Elixir applications using SDK, SMTP, or RESTful API for email sending
Last updated
Was this helpful?
Was this helpful?
def deps do
[
{:mailtrap, "~> 0.2.0"}
]
endmix deps.getclient = Mailtrap.Sending.client("PASTE TOKEN HERE")
email = (%Mailtrap.Email{}
|> Mailtrap.Email.put_from({"From name", "from@example.com"})
|> Mailtrap.Email.put_to({"Recepient", "recepient@example.com"})
|> Mailtrap.Email.put_subject("Hi there")
|> Mailtrap.Email.put_text("General Kenobi"))
Mailtrap.Sending.send(client, email)