Z
Z
Zaur Ashurbekov2014-10-11 20:28:47
gmail
Zaur Ashurbekov, 2014-10-11 20:28:47

Why does Net::SMTPAuthenticationError occur?

Hello Toaster!
I'm trying to send an email via Rails, but I'm getting an error:

Net::SMTPAuthenticationError (534-5.7.14 <https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbvm6
):
  app/controllers/pages_controller.rb:11:in `send_email'

send_email:
def send_email
        @client = Client.new(user_params)
        if @client.save
            AppMailer.welcome_email(@client).deliver
        end
    end

Settings in Development.rb:
config.action_mailer.delivery_method = :smtp
  config.action_mailer.raise_delivery_errors = true
  ActionMailer::Base.smtp_settings = {
    :address        => 'smtp.gmail.com',
    :domain         => 'gmail.com',
    :port           => 587,
    :user_name      => 'мой_майл@gmail.com',
    :password       => 'пароль',
    :authentication => :plain,
    :enable_starttls_auto => true
  }

Here's more from the logs:
Sent mail to Куда@mail.ru (1407.7ms)
Date: Sat, 11 Oct 2014 21:10:53 +0400
From: Откуда@gmail.com
To: Куда@mail.ru
Message-ID: <[email protected]>
Subject: =?UTF-8?Q?=D0=97=D0=B0=D0=BA=D0=B0=D0=B7_45?=
Mime-Version: 1.0
Content-Type: text/html;
 charset=UTF-8
Content-Transfer-Encoding: base64

Access to the box opened

Answer the question

In order to leave comments, you need to log in

2 answer(s)
_
_ _, 2014-10-11
@zaurius

It looks like gmail saw some suspicious activity in this submission of yours.
Login to your gmail account. If I'm right, then he will ask you, they say, someone here tried to spam on your behalf, was it you or not?

M
molchanov_a, 2015-12-06
@molchanov_a

You may need to change your security settings https://www.google.com/settings/security/lesssecureapps

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question