前提・実現したいこと
「環境変数を使用したdeviseを利用したメール認証機能とパスワード再設定機能の実装」
user_name、password、address、domainの部分を環境変数に変換したがエラーになりアカウント確認メールや再設定のためのメールがこない。
config.action_mailer.raise_delivery_errors = true
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => 'smtp.gmail.com',
:port => 587,
:domain => 'example.com',
:user_name => 'example@gmail.com',
:password => 'dlapwoeifkbmzksl', # Googleが発行する、12桁のアプリケーションパスワード
:authentication => :login,
:enable_starttls_auto => true
}
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
port: 587,
address: ENV['ADDRESS'],
domain: ENV['DOMAIN'],
user_name: ENV['USER_NAME'],
password: ENV['PASSWORD'],
authentication: 'login',
enable_starttls_auto: true
}
ここに質問の内容を詳しく書いてください。
(例)PHP(CakePHP)で●●なシステムを作っています。
■■な機能を実装中に以下のエラーメッセージが発生しました。
発生している問題・エラーメッセージ
エラーメッセージ Net::SMTPAuthenticationError in Devise::PasswordsController#create 530-5.7.0 Authentication Required. Learn more at Extracted source (around line #969): 967 968 969 970 971 972 def check_response(res) unless res.success? raise res.exception_class, res.message end end
該当のソースコード
Ruby on Rails
試したこと
https://qiita.com/Yinaura/items/6886682a607951a71bac
https://qiita.com/Yinaura/items/6886682a607951a71bac
https://qiita.com/yuichir43705457/items/7cfcae6546876086b849
補足情報(FW/ツールのバージョンなど)
ここにより詳細な情報を記載してください。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/11/07 09:14
2020/11/07 09:44