我不能理解关于电子邮件的一些微不足道的东西,但defaul_url_options中的主机是做什么的?我需要配置smtp设置来配置电子邮件的发送方式,但default_url_options与此有关吗?什么是ActionMailer default_url_options?
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp
host = '<your heroku app>.herokuapp.com'
config.action_mailer.default_url_options = { host: host }
ActionMailer::Base.smtp_settings = {
:address => 'smtp.sendgrid.net',
:port => '587',
:authentication => :plain,
:user_name => ENV['SENDGRID_USERNAME'],
:password => ENV['SENDGRID_PASSWORD'],
:domain => 'heroku.com',
:enable_starttls_auto => true
}