ruby-on-railsactionmailerconfirmation-email

Error when sending email confirmation using ActionMailer on ROR


I am developing a website using ROR on Windows 7 (64-bit). I am trying to setup my website so that a person who creates a new login on it gets a confirmation email. I am using ActionMailer for the email confirmation sending. I am trying to configure it to send confirmation email using Gmail SMTP server. (This is just for testing. Once it works, I can use something else on the deployment server.)

I am getting this error:

   Application-specific password required

Here is the code snippet from development.rb:

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

        # these options are only needed if you choose smtp delivery
       config.action_mailer.smtp_settings = {
       :address        => 'smtp.gmail.com',
       :port           => 587,
       :domain         => 'gmail.com',
       :authentication => :login,
       :user_name      => 'my_login@gmail.com',
       :password       => 'my_application_specific_password'
       }

Why I am getting this error even though I generated a new application-specific password for this purpose and am using it? How to fix this?


Solution

  • I think you may have enabled extra 2-step security on the Google Account you are using to send emails. This can require you to sign in using a special code sent to your mobile phone by text message; or for particular non-compatible applications, creating an 'Application-specific password'.

    More details on Application-specific passwords here.