Configure outbound SMTP email via Swoosh with TLS

This commit is contained in:
Graham McIntire 2026-04-02 13:08:50 -05:00
parent 2f65c4648c
commit 2f9d645c50
No known key found for this signature in database
GPG key ID: F4ABF488E6029E59
2 changed files with 13 additions and 12 deletions

View file

@ -14,8 +14,8 @@ config :microwaveprop, MicrowavepropWeb.Endpoint, cache_static_manifest: "priv/s
# config :microwaveprop, MicrowavepropWeb.Endpoint,
# force_ssl: [rewrite_on: [:x_forwarded_proto]]
# Configure Swoosh API Client
config :swoosh, api_client: Swoosh.ApiClient.Req
# SMTP adapter doesn't need an API client
config :swoosh, api_client: false
# Runtime production configuration, including reading

View file

@ -122,14 +122,15 @@ if config_env() == :prod do
#
# config :microwaveprop, Microwaveprop.Mailer,
# adapter: Swoosh.Adapters.Mailgun,
# api_key: System.get_env("MAILGUN_API_KEY"),
# domain: System.get_env("MAILGUN_DOMAIN")
#
# Most non-SMTP adapters require an API client. Swoosh supports Req, Hackney,
# and Finch out-of-the-box. This configuration is typically done at
# compile-time in your config/prod.exs:
#
# config :swoosh, :api_client, Swoosh.ApiClient.Req
#
# See https://hexdocs.pm/swoosh/Swoosh.html#module-installation for details.
config :microwaveprop, Microwaveprop.Mailer,
adapter: Swoosh.Adapters.SMTP,
relay: System.get_env("EMAIL_SERVER"),
port: 587,
username: System.get_env("EMAIL_USERNAME"),
password: System.get_env("EMAIL_PASSWORD"),
tls: :if_available,
auth: :always,
ssl: false
config :microwaveprop, :email_from, {"NTMS Propagation", "graham@w5isp.com"}
end