peter-de-boer
Network failure using Swoosh
I am trying to use swoosh for emailing. I have basically followed the steps in Swoosh.Mailer — Swoosh v1.3.5.
My config looks like:
config :bw, Bw.Mailer,
adapter: Swoosh.Adapters.SMTP,
relay: "smtp.gmail.com",
username: System.get_env("BW_MAIL_USERNAME"), # gmail username
password: System.get_env("BW_MAIL_PASSWORD"), # gmail password
ssl: true,
tls: :always,
auth: :always,
port: 1025,
retries: 2,
no_mx_lookups: false
I have created an email struct, but when I try to deliver it, I get:
> Bw.Mailer.deliver(email)
{:error, {:retries_exceeded, {:network_failure, '108.177.126.109', {:error, :timeout}}}}
I have no idea where the error could be. Is it in my configuration? Any help is appreciated.
Marked As Solved
derek-zhou
You sure the port 1025 is correct? Usually SMTP with STARTTLS is on port 587, ans SSL SMTP is on 465.
Also, Gmail SMTP is supposed to be used by interactive clients, not a backend server. They may have some rule based filtering and limiting that hinder your usage. I 'd stick to one of the following:
- Sendgrid, etc, 100 mails per day in the free tier
- Amazon SES. If you are sending a lot
- Your own SMTP server
1
Also Liked
ndan
Working settings for Gmail (port 587)
config :sample, Sample.Mailer,
adapter: Swoosh.Adapters.SMTP,
relay: "smtp.gmail.com",
username: "name@gmail.com",
password: "apppassword",
ssl: false,
tls: :always,
auth: :always,
port: 587,
retries: 2
Requirements for Gmail:
- Set up 2-Step Verification
- Generate app password
- Switch off your VPN (if you’re testing on localhost)
2
Popular in Questions
Hi! May someone helps me, please!
I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
can someone please explain to me how Enum.reduce works with maps
New
Hello all!
I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
Hi there, I'm working through my first release with elixir/phoenix. I've built a release with distillery and found that it crashes when I...
New
I would like to know what is the best IDE for elixir development?
New
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this
"1000"
What is the ...
New
Hello, I have map which I want to convert it to string like this:
the map:
%{last_name: "tavakkoli", name: "shahryar"}
the string I ne...
New
Hello everybody,
usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
Mix format works fine if run from the cmd. I’ve followed this to facilitate the implementation into VSC which involves downloading an ext...
New
Hi,
I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
Other popular topics
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
Hello!
Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
Hi all,
Trying to get some more clarity over utc_datetime and naive_datetime for Ecto:
https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
I would like to know what is the best IDE for elixir development?
New
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
Hey,
Just curious what are the main benefits of Elixir compared to Clojure?
When is Elixir more useful than Clojure and vice versa?
Th...
New
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
Hey all,
I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
Hi everyone,
One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New







