在ROR上使用ActionMailer发送电子邮件确认时出错

Oat*_*eal 2 ruby-on-rails actionmailer confirmation-email

我正在使用Windows 7(64位)上的ROR开发一个网站.我正在尝试设置我的网站,以便在其上创建新登录的人收到确认电子邮件.我正在使用ActionMailer进行电子邮件确认发送.我正在尝试将其配置为使用Gmail SMTP服务器发送确认电子邮件.(这只是用于测试.一旦它工作,我可以在部署服务器上使用其他东西.)

我收到此错误:

   Application-specific password required
Run Code Online (Sandbox Code Playgroud)

以下是来自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'
       }
Run Code Online (Sandbox Code Playgroud)

为什么我收到此错误,即使我为此目的生成了一个新的应用程序专用密码并且正在使用它?如何解决这个问题?

Rob*_*ice 5

我们认为您可能已在用于发送电子邮件的Google帐户上启用了额外的两步安全保护.这可能要求您使用通过短信发送到手机的特殊代码登录; 或者对于特定的非兼容应用程序,创建"应用程序专用密码".

在应用专用密码的更多细节在这里.