# Mailer Authentification required

**URL:** <https://forum.elixirforum.com/t/mailer-authentification-required/40939>\
**Category:** Questions\
**Tags:** email, bamboo\
**Created:** [July 9, 2021, 6:57am UTC](https://forum.elixirforum.com/t/mailer-authentification-required/40939 "2021-07-09T06:57:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![KevIrinah](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/k/74df32/32.png) [@KevIrinah](https://forum.elixirforum.com/u/KevIrinah)\
**Post date:** [July 9, 2021, 6:57am UTC](https://forum.elixirforum.com/t/mailer-authentification-required/40939/1 "2021-07-09T06:57:15Z")

</div>

Hey guys, I’m designing a website and i need to send email to a customer.

But when i use **Mailer.deliver\_later/1** or **deliver\_now/1** i receive an error.  
I don’t know where is the cause of this error.

My config.exs:

```elixir
config :shopTest, ShopTest.Mailer,
  adapter: Bamboo.SMTPAdapter,
  server: "smtp.gmail.com",
  port: 587,
  username: " **** @gmail.com",
  password: " *******",
  tls: :if_available,
  ssl: false,
  retries: 1

```

and my module Email:

```elixir
defmodule Email do
  use Bamboo.Phoenix, view: ShopTest.EmailView

  def welcome_text_email(email_address) do
    new_email()
    |> to(email_address)
    |> from(" ********.com")
    |> subject("Welcome!")
    |> text_body("Welcome to MyApp!")
  end
end

```

and my mailer.ex

```elixir
defmodule ShopTest.Mailer do
  use Bamboo.Mailer, otp_app: :shopTest
end

```

`Thank you for your help guys!

---

<div class="post-metadata">

**Author:** ![muelthe](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/muelthe/32/35411_2.png) [@muelthe](https://forum.elixirforum.com/u/muelthe)\
**Post date:** [July 9, 2021, 7:13am UTC](https://forum.elixirforum.com/t/mailer-authentification-required/40939/2 "2021-07-09T07:13:29Z")

</div>

Heya, can you post the error?

---

<div class="post-metadata">

**Author:** ![KevIrinah](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/k/74df32/32.png) [@KevIrinah](https://forum.elixirforum.com/u/KevIrinah)\
**Post date:** [July 9, 2021, 7:18am UTC](https://forum.elixirforum.com/t/mailer-authentification-required/40939/3 "2021-07-09T07:18:19Z")

</div>

@muelthe yes sorry ,

```elixir

[error] Task #PID<0.418.0> started from #PID<0.415.0> terminating
** (Bamboo.SMTPAdapter.SMTPError) There was a problem sending the email through SMTP.

The error is :no_more_hosts

More detail below:

{:permanent_failure, "smtp.gmail.com", "530-5.7.0 Authentication Required. Learn more at\r\n530 5.7.0 https://support.google.com/mail/?p=WantAuthError m7sm10456280wms.0 - gsmtp\r\n"}

    (bamboo_smtp 1.2.1) lib/bamboo/adapters/smtp_adapter.ex:74: Bamboo.SMTPAdapter.handle_response/1
    (elixir 1.11.3) lib/task/supervised.ex:90: Task.Supervised.invoke_mfa/2
    (stdlib 3.8) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Function: #Function<0.19346564/0 in Bamboo.TaskSupervisorStrategy.deliver_later/3>
    Args: []

```

---

<div class="post-metadata">

**Author:** ![muelthe](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/muelthe/32/35411_2.png) [@muelthe](https://forum.elixirforum.com/u/muelthe)\
**Post date:** [July 9, 2021, 7:26am UTC](https://forum.elixirforum.com/t/mailer-authentification-required/40939/4 "2021-07-09T07:26:19Z")

</div>

It’s sending but looks like it’s being rejected by the relay service (smtp status 570) for security reasons. I’ve never used the gmail relay, but there might be a policy that requires a certain configuration e.g. the use of SSL

I found a recent’ish article here that goes into a bit more detail about using their service: [How to Use the Gmail SMTP Server to Send Emails for Free](https://kinsta.com/blog/gmail-smtp-server/)
