peter-de-boer
I am trying to use swoosh for emailing. I have basically followed the steps in Swoosh.Mailer — Swoosh v1.26.2.
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.
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
Hi all,
I’m working on a Phoenix project where I need to make external HTTP requests and I’m trying to choose between Req and HTTPoison....
New
How do I tell Hologram not to escape HTML when substituting into templates?
{Textile.render(@product.long_description)}
escapes the HTM...
New
I’d like to create a file with 600 permissions (rw-------), but there’s a race condition if I create it and then change the permissions. ...
New
Hi,
we run different LLM models across a cluster, with each node loading a configurable subset. Model-specific queues let nodes consume ...
New
When I use Mix.install with a git dependency, using git@github.com:... how do I change the SSH identity used?
I’ve got two Github accoun...
New
Hello all. I have a question as to best practices for code organization when implementing a liveview with a lot of responsibilities.
Sup...
New
Other Trending Topics
Hey there,
I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first.
...
New
Hi everyone :waving_hand:
I wanted to share something I’ve been building — NowBlind, a random chat app designed to help people discover ...
New
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly)
AI dream has many faces, but general...
New
Localize is the next generation localisation library for Elixir. Think of it as ex_cldr version 3.0. The first version will be released ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #code-sync
- #discussion
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #ai
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #blog-post
- #elixirconf-us
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #elixirconf-eu
- #processes
- #security
- #api
- #forms
- #performance










Showing Posts 1 to 6- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
dimitarvp
Have you tried manually invoking the API through
curland check if you get a similar error?peter-de-boer
Thanks for the suggestion! Just tried to send an email by curl, and that works.
Any idea how to debug this?
dimitarvp
As a start, use curl like this:
curl -iv ..., that way you’ll see both request and response headers.Then, you can try and see which headers does
swooshuse when sending the request. In the ideal case it’ll have a way for you to control them. And then try to equalize what you’ve seen on the CLI withcurland what your Elixir code does.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:
peter-de-boer
Thanks! Yes, the port was wrong, among other things. I had just copied it from an example, I did not realize I had to change it to a specific value.
It had to change the port to 465, and set tls: if_available. Port 587 did not work though.
Besides that, I found out that, despite what the Swoosh doc suggests, that the emails must have a text_body.
Now the emails are working.
And yes, I will move to some other SMTP server, I just wanted to do a few tests using my gmail account. Thanks for the suggestions!
ndan
Working settings for Gmail (port 587)
Requirements for Gmail: