› Ruby 勉強会 › Net::SMTPAuthenticationError
Net::SMTPAuthenticationError
2014年04月01日
Net::SMTPAuthenticationError 534-5.7.9 Application-specific password required.
ActionMailerを使用中に遭遇したエラー。
webで見つかる例では、すんなり動いている人が多い中。だいぶハマってしまった。
Googleの2段階認証(2-Step Verification)に切り替えていると、通常のパスワードでは駄目みたい。
アプリケーション固有パスワード(application-specific password)を発行して設定してあげるとOK。
#config\environments\development.rb
config.action_mailer.delivery_method = :smtp
config.action_mailer.raise_delivery_errors = true
config.action_mailer.smtp_settings = {
address: "smtp.gmail.com",
port: 587,
domain: "smtp.gmail.com",
authentication: "plain",
user_name: "my_account@gmail.com",
password: "xxxxxxxxxxxxxxxx", # <= アプリケーション固有パスワード
enable_starttls_auto: true
}
Posted by kanedayo at 01:13│Comments(0)