Swoosh.Adapters.Sendmail (Swoosh v1.29.3)

Copy Markdown View Source

An adapter that sends email using the sendmail binary.

The binary is executed directly, not through a shell, so cmd_path must be an absolute path (a relative one is looked up in PATH, which is deprecated) and cmd_args must be a list of arguments. A string cmd_args is deprecated: it is split into arguments honoring quotes and backslash escapes, but no other shell syntax (pipes, redirects, variables) is supported.

Example

# config/config.exs
config :sample, Sample.Mailer,
  adapter: Swoosh.Adapters.Sendmail,
  cmd_path: "/usr/bin/sendmail",
  cmd_args: ["-N", "delay,failure,success"],
  qmail: true # Default false

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

Summary

Functions

deliver(email, config)

Callback implementation for Swoosh.Adapter.deliver/2.

validate_config(config)

Callback implementation for Swoosh.Adapter.validate_config/1.

validate_dependency()

Callback implementation for Swoosh.Adapter.validate_dependency/0.