CE Install Won't Send Email via SMTP or SendGrid API #4765
Replies: 3 comments 1 reply
-
And here's a debug log of the generated email:
|
Beta Was this translation helpful? Give feedback.
-
I'll open a PR to improve the error message, but in the meanwhile let's get the full error by sending the email manually. $ cd plausible-ce
$ docker compose exec plausible bin/plausible remote iex> Application.get_env(:plausible, Plausible.Mailer)
# just a sanity check, what does it return? note that it would show some secrets, they can be redacted :)
iex> you = "[email protected]"
iex> email = Bamboo.Email.new_email(to: you, from: PlausibleWeb.Email.mailer_email_from(), text_body: "test")
iex> Plausible.Mailer.deliver_now(email)
# what does it return? You can try it both with SMTP and SendGrid adapters. Note that the SendGrid adapter doesn't use SMTP but HTTP. |
Beta Was this translation helpful? Give feedback.
-
Well I'll be pickled! You're a genius. I know where to go to try and resolve the issue now. Sender Identity 🤦🏻♂️ Thanks so much for the quick response. I'm confident I can solve this post haste. ==== iex(86272997cf0d)3> email = Bamboo.Email.new_email(to: you, from: PlausibleWeb.Email.mailer_email_from(), text_body: "test") |
Beta Was this translation helpful? Give feedback.
-
I've tried everything and am pulling my hair out. New CE install, and no matter what I can't get it to send email.
Here's the log. Very illuminating...
plausible-ce-plausible-1 | Loading plausible..
plausible-ce-plausible-1 | Starting dependencies..
plausible-ce-plausible-1 | Starting repos..
plausible-ce-plausible-1 | Plausible.Repo database already exists
plausible-ce-plausible-1 | Plausible.IngestRepo database already exists
plausible-ce-plausible-1 | Creation of Db successful!
plausible-ce-plausible-1 | Loading plausible..
plausible-ce-plausible-1 | Starting dependencies..
plausible-ce-plausible-1 | Starting repos..
plausible-ce-plausible-1 | 01:06:01.395 [notice] Certificate for REDACTED is valid until 2025-01-30. Next renewal is scheduled for 2024-12-31.
plausible-ce-plausible-1 | 01:06:11.771 request_id=GAQBSVPp9Sh6ZGYAACOB [error] Failed to send e-mail
"Failed to send e-mail"? No kidding!
I tried turning on LOG_LEVEL=debug and it shows the email assembled, but there's no further details about why it's failing to send.
I have tried telnet from the server and both 25 and 587 work fine and I can manually get the AUTH to work using the info I've put into the .env so that's not the issue. I have tried both Bamboo.Mua and Bamboo.SendGridAdapter, as well as SMTP settings for SendGrid and the SendGrid API Key.
Help! Here's my current .env file:
MAILER_ADAPTER=Bamboo.Mua
MAILER_EMAIL=[email protected]
MAILER_NAME=Plausible
SMTP_HOST_ADDR=smtp.sendgrid.net
SMTP_HOST_PORT=587
SMTP_USER_NAME=apikey
SMTP_USER_PWD=SG.redacted
SMTP_HOST_SSL_ENABLED=false
SENDGRID_API_KEY=SG.redacted
Beta Was this translation helpful? Give feedback.
All reactions