Hey guys, I’m having issues with email authorization in production environment, in development environment it works normally and the email is send.
The environment variables are correct.
This is the error that appears in Bugsnag
Erlang error: {{{:nocatch, {:permanent_failure, "530 Authentication required\r\n"}}, [{:gen_smtp_client, :try_MAIL_FROM, 4, [file: '/app/deps/gen_smtp/src/gen_smtp_client.erl', line: 360]}, {:gen_smtp_client, :try_sending_it, 4, [file: '/app/deps/gen_smtp/src/gen_smtp_client.erl', line: 341]}, {:gen_smtp_client, :send_it, 2, [file: '/app/deps/gen_smtp/src/gen_smtp_client.erl', line: 262]}, {Bamboo.SMTPAdapter, :deliver, 2, [file: 'lib/bamboo/adapters/smtp_adapter.ex', line: 77]}, {Bamboo.Mailer, :deliver_now, 4, [file: 'lib/bamboo/mailer.ex', line: 161]}
This is my configurations
config.exs
config :messenger, Messenger.Mailer.Mailer,
adapter: Bamboo.SMTPAdapter,
server: "email-smtp.us-east-1.amazonaws.com",
port: 587,
username: System.get_env("AWS_SES_ACCESS_KEY_ID"),
password: System.get_env("AWS_SES_SECRET_ACCESS_KEY"),
retries: 3
Mailer.ex
defmodule Messenger.Mailer.Mailer do
use Bamboo.Mailer, otp_app: :messenger
end
mix.exs deps
defp deps do
[
{:excoveralls, "~> 0.13", only: :test},
{:jason, "~> 1.2"},
{:joken, "~> 2.0"},
{:bamboo, "~> 1.5.0"},
{:bamboo_smtp, "~> 3.0"},
{:phoenix, "~> 1.5.3"},
{:phoenix_html, "~> 2.14.2"},
{:ex_image_info, "~> 0.2.4"}
]
end