Swoosh.Adapters.SMTP (Swoosh v1.3.3) View Source

An adapter that sends email using the SMTP protocol.

Underneath this adapter uses the gen_smtp library.


# mix.exs
def application do
  [applications: [:swoosh, :gen_smtp]]

# config/config.exs
config :sample, Sample.Mailer,
  adapter: Swoosh.Adapters.SMTP,
  relay: "smtp.avengers.com",
  username: "tonystark",
  password: "ilovepepperpotts",
  ssl: true,
  tls: :always,
  auth: :always,
  port: 1025,
  dkim: [
    s: "default", d: "domain.com",
    private_key: {:pem_plain, File.read!("priv/keys/domain.private")}
  retries: 2,
  no_mx_lookups: false

# lib/sample/mailer.ex
defmodule Sample.Mailer do
  use Swoosh.Mailer, otp_app: :sample

Link to this section Summary

Link to this section Functions

Callback implementation for Swoosh.Adapter.validate_config/1.

Callback implementation for Swoosh.Adapter.validate_dependency/0.