Bamboo SMTP Adapter v1.6.0 Bamboo.SMTPAdapter View Source

Sends email using SMTP.

Use this adapter to send emails through SMTP. This adapter requires that some settings are set in the config. See the example section below.

Sensitive credentials should not be committed to source control and are best kept in environment variables. Using {:system, "ENV_NAME"} configuration is read from the named environment variable at runtime.

Example config

# In config/config.exs, or config.prod.exs, etc.
config :my_app, MyApp.Mailer,
  adapter: Bamboo.SMTPAdapter,
  server: "smtp.domain",
  hostname: "www.mydomain.com",
  port: 1025,
  username: "your.name@your.domain", # or {:system, "SMTP_USERNAME"}
  password: "pa55word", # or {:system, "SMTP_PASSWORD"}
  tls: :if_available, # can be `:always` or `:never`
  allowed_tls_versions: [:"tlsv1", :"tlsv1.1", :"tlsv1.2"],
  # or {":system", ALLOWED_TLS_VERSIONS"} w/ comma seprated values (e.g. "tlsv1.1,tlsv1.2")
  ssl: false, # can be `true`,
  retries: 1,
  no_mx_lookups: false, # can be `true`
  auth: :if_available # can be `always`. If your smtp relay requires authentication set it to `always`.

# Define a Mailer. Maybe in lib/my_app/mailer.ex
defmodule MyApp.Mailer do
  use Bamboo.Mailer, otp_app: :my_app
end

Link to this section Summary

Link to this section Functions

Callback implementation for Bamboo.Adapter.deliver/2.