Rails Email Error - 530-5.5.1 Authentication Required

rails email error - 530-5.5.1 Authentication Required.

I did the same using my Gmail, following are my configurations, try and see it if works

  config.action_mailer.default_url_options = { :host => 'localhost:3000' }
ActionMailer::Base.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:authentication => :plain,
:user_name => "<my gmail>@gmail.com",
:password => "<my gmail password>",
:openssl_verify_mode => 'none'
}

and please note the

:openssl_verify_mode  => 'none'

section to skip the SSL errors.

But sorry, I have no idea what the error is, probably you try to use the Gmail SMTP server with another domain name.

Net::SMTPAuthenticationError (530-5.5.1 Authentication Required. Learn more at ):

I would like to suggests you to follow up with

  • Railsapps -Send Mail and

  • Railsapps -rails-environment-variables

Would Definitely help You

Edit Update

Allow less secure apps to access accounts

Google may block sign-in attempts from some apps or devices that do
not use modern security standards. Since these apps and devices are
easier to break into, blocking them helps keep your account safe.

Some examples of apps that do not support the latest security
standards include:

  • The Mail app on your iPhone or iPad with iOS 6 or below The Mail app

  • on your Windows phone preceding the 8.1 release Some Desktop mail

  • clients like Microsoft Outlook and Mozilla Thunderbird

Gmail SMTP: Net::SMTPAuthenticationError (530-5.5.1 Authentication Required. Learn more at

how about change the host without http (see sample below)
another idea is also check your system environment access your secret_data variabel whether it's work / not (ENV["GMAIL_PASSWORD"]

  config.action_mailer.default_url_options = { :host => "xxx.xxx.xxx.xxx" }

config.action_mailer.delivery_method=:smtp
config.action_mailer.raise_delivery_errors = true

# Gmail SMTP server setup
ActionMailer::Base.smtp_settings = {
:address => "smtp.gmail.com",
:enable_starttls_auto => true,
:port => 587,
:authentication => :plain,
:user_name => "your username",
:password => 'your pass'
}

Rails mailer smtp authentication error

Reason: Google was blocking access from unknown location (app in production)

Solution: go to following link and turn on https://www.google.com/settings/security/lesssecureapps

530-5.5.1 Authentication Required. Learn more at

I did the same using my gmail, following are my configurations, try and see it if works

config.action_mailer.default_url_options = { :host => 'localhost:3000' }

ActionMailer::Base.smtp_settings = {

:address => "smtp.gmail.com",
:port => 587,
:authentication => :plain,
:user_name => "<my gmail>@gmail.com",
:password => "<my gmail password>",
:openssl_verify_mode => 'none' }

Please note the:

:openssl_verify_mode => 'none'

section to skip the ssl errors

Mailer error Gmail Net::SMTPAuthenticationError in EnglishGradesController#create

The problem was actually that

 :authentication       => "plain",

needed to be:

 :authentication       => "login",


Related Topics



Leave a reply



Submit