Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble sending email over Gmail #191

Closed
sh4t4d33p opened this issue Jan 5, 2018 · 7 comments
Closed

Trouble sending email over Gmail #191

sh4t4d33p opened this issue Jan 5, 2018 · 7 comments

Comments

@sh4t4d33p
Copy link

I have created a basic email sending application. I have tested it locally using the mailbox preview server. However, when I change the configuration to send the email over Gmail, I get errors.

  1. When I use port 1025, the error is:- {:error, {:retries_exceeded, {:network_failure, 'smtp.gmail.com', {:error, :timeout}}}}.
  2. When I use port 465, I get:- {:error, {:retries_exceeded, {:network_failure, 'smtp.gmail.com', {:error, :closed}}}}.
  3. When I use port 587, I get:- {:error, {:no_more_hosts, {:permanent_failure, 'smtp.gmail.com', :auth_failed}}}.

My config.exs looks like this:-
config :my_app, MyApp.Mailer, adapter: Swoosh.Adapters.SMTP, relay: "smtp.gmail.com", username: "some.name@gmail.com", password: "password", tls: :always, auth: :always, port: 587
I enabled access through less secure apps in my Gmail account, but it's still not working. Could somebody tell me what the problem is?

@stevedomin
Copy link
Member

Hello @sh4t4d33p, sorry to hear you're having issues sending email with Swoosh/Gmail.

Do you have two-factor authentication enabled on this account by any chance? If that's the case you will need to generate an app specific password: https://support.google.com/accounts/answer/185833?hl=en

@sh4t4d33p
Copy link
Author

If you mean the 2-step verification which uses the password and a unique verification code, then I don't have it enabled.

@stevedomin
Copy link
Member

@sh4t4d33p I'm assuming this is no longer an issue and closing. Please reopen if that's not the case.

@ugifractal
Copy link

FYI: I am using mailman elixir and maybe same issue with swoosh, using mailman I got

{:error, {:no_more_hosts, {:permanent_failure, 'smtp.gmail.com', :auth_failed}}}

but the error only happen on production, tried locally working good.

Then I changed the google account to the business account then working nicely.

So I think the problem is coming from SMTP account and (maybe) related to server IP address.

@mbaraa
Copy link

mbaraa commented Aug 7, 2023

Hello @stevedomin, the mentioned issue is still going on!

@princemaple
Copy link
Member

@mbaraa please file a new issue with your detailed error messages. Thanks!

@mbaraa
Copy link

mbaraa commented Aug 8, 2023

@princemaple it's already open in #785, I'll try the mentioned solution first I guess!

@swoosh swoosh locked and limited conversation to collaborators Aug 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants