Forum: Ruby on Rails Mail notifications to self Net::SMTPAuthenticationError

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
bradford li (Guest)
on 2014-11-18 21:23
(Received via mailing list)
I am trying to set up a mailer to send myself notification methods. I am
currently trying to get the mailer to send myself a simple message when
go to the URL `localhost:3000/send_mail`

I am currently getting this error:

    Net::SMTPAuthenticationError in HomeController#send_mail
    534-5.7.9 Application-specific password required


      config.action_mailer.raise_delivery_errors = true
      host = 'localhost:3000'
      config.action_mailer.default_url_options = { host: host }
      config.action_mailer.delivery_method = :smtp
      config.action_mailer.smtp_settings = {
        address:              '',
        port:                 587,
        domain:               '',
        user_name:            '',
        password:             'mypwd',
        authentication:       'plain',
        enable_starttls_auto: true  }


   match '/send_mail', to: "home#send_mail", via: "get"

home controller:

    class HomeController < ApplicationController
      def index

      def send_mail
      ActionMailer::Base.mail(:from => "", :to =>
"", :subject => "Contact request", :body =>
        render nothing: true
wdperson (Guest)
on 2014-11-18 21:34
(Received via mailing list)

The reason you are getting that error is because more than likely you
set up 2 factor authentication with Google/Gmail.  So it is saying you
to include a application specific password.  In other words don't use
usual login password, create an application specific password on
Google/Gmail and then use that in your smtp settings.  Hope this helps.

Mike Riley
Rob Biedenharn (Guest)
on 2014-11-18 21:35
(Received via mailing list)
bradford li (Guest)
on 2014-11-18 21:43
(Received via mailing list)
Thank you!! worked like a charm!
bradford li (Guest)
on 2014-11-18 21:43
(Received via mailing list)
thank you!!! worked perfectly!!
This topic is locked and can not be replied to.