2

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?

Oatmeal
  • 759
  • 2
  • 9
  • 25
  • Your question looks quite similar to this: http://stackoverflow.com/questions/10991932/sending-confirmation-emails-to-registered-users-in-ror-app-via-localhost/10994387#10994387 – Someth Victory Jun 13 '12 at 01:30

1 Answers1

5

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.

Rob d'Apice
  • 2,416
  • 1
  • 19
  • 29
  • Thanks Rob! I have 2-factor authentication enabled on my Google account. But, I have generated an application specific password and that is what I am using in the configuration above. Any idea what else might be going wrong? – Oatmeal Jun 13 '12 at 01:43
  • 1
    Hm... Have you tried changing `:authentication => :login` to `:authentication => :plain`? – Rob d'Apice Jun 13 '12 at 01:51