Heroku日志说已发送电子邮件,但我收不到。在本地它可以工作,我收到MailCatcher的电子邮件。
production.rb
config.action_mailer.default_url_options = {:host => 'rails-follow.herokuapp.com'}
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = false
config.action_mailer.default :charset => "utf-8"
config.action_mailer.smtp_settings = {
address: "smtp.gmail.com",
port: 587,
domain: ENV["gmail.com"],
authentication: "plain",
enable_starttls_auto: true,
user_name: ENV["rorymunro123@gmail.com"],
password: ENV["PASSWORD"]
}
Heroku配置:
DATABASE_URL: postgres://onbifhsiwcwyzn:nm78UwuX1hKby32PZsfXSgEjqi@ec2-54-197-241-95.compute-1.amazonaws.com:5432
HEROKU_POSTGRESQL_SILVER_URL: postgres://onbifhsiwcwyzn:nm78UwuX1hKby32PZsfXSgEjqi@ec2-54-197-241-95.compute-1.amazonaws.com:5432/
LANG: en_US.UTF-8
RACK_ENV: production
RAILS_ENV: production
SECRET_KEY_BASE: Long number
提前致谢。