Mail in mix with Bamboo doesnt send


defmodule Mailer do
  import Bamboo.Email

  def email do
      from: "",
      to: "",
      subject: "Movie Added",
      text_body: "A movie was added.",
      html_body: "A movie was added."


config :somemail, MailoingMail.Mailer,
  adapter: Bamboo.GmailAdapter,
  email: "",
  password: "secret-password"

when I run the function, I get

  from: "",
  to: "",
  cc: nil,
  bcc: nil,
  subject: "Movie Added",
  html_body: "A movie was added.",
  text_body: "A movie was added.",
  headers: %{},
  attachments: [],
  assigns: %{},
  private: %{},
  blocked: false

but I dont receive the email, why?

Hi @spizzy I think you just needed to keep reading further into the docs. The code you’ve written simply constructs an email, but it doesn’t ask Bamboo to send it yet. From the docs:

defmodule MyApp.SomeControllerPerhaps do
  def send_welcome_email do
    Email.welcome_email()   # Create your email
    |> Mailer.deliver_now!() # Send your email

I tried that, somehow always saying that deliver_now is not available or undefined

Can you show your code and the exact error?

** (exit) exited in:, {:find, {:default, "", ""}}, 5000)
    ** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started
def start(_type, _args) do
    children = [
      # add bamboo
      {Bamboo, name: CustomMail.Mailer}

    opts = [strategy: :one_for_one, name: CustomMail.Supervisor]
    Supervisor.start_link(children, opts)

I have some problems with the genserver as far as I can guess from the error :confused:

Right, so the error you’re getting is that Goth.TokenStore isn’t running, not that your deliver function doesn’t exist. This indicates that your google credentials (via goth) haven’t been set up correctly. Can you print the output of mix deps ?

Looks like this same discussion is being had in the Elixir Discord, in the interest of preventing double work from community members, you might want to read that discussion also (if you are on the Discord): Discord