我正在使用设备,但未发送确认和忘记密码邮件。我已经应用了这段代码
devise.rb
config.mailer = 'Devise::Mailer'
developement.rb
config.action_mailer.default_url_options = { :host => "localhost:3000" }
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.smtp_settings = {
:address ![enter image description here][2] => 'smtp.gmail.com',
:port => 458,
:domain => 'gmail.com',
:user_name => 'xyz@gmail.com',
:password => '123456',
:authentication => 'plain',
:enable_starttls_auto => true
}
Smtp正在寻找其他项目。请建议我在哪里错了
答案 0 :(得分:0)
请将端口:458更新为:port => 587
答案 1 :(得分:0)
它应该可以正常工作
config.action_mailer.default_url_options = { :host => "localhost:3000" }
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
config.action_mailer.smtp_settings = {
:address => 'smtp.gmail.com',
:port => 587,
:domain => 'gmail.com',
:user_name => 'xyz@gmail.com',
:password => '123456',
:authentication => 'plain',
:enable_starttls_auto => true
}