Sendgrid不发送电子邮件
问题描述:
我加sendgrid
我在Heroku上的应用程序作为我的电子邮件发件人,但每次用户尝试注册,与文本“www.mydomain.com" is currently unable to handle this request"
。Heroku的日志不显示任何错误发生错误。这是我的production.rb
:Sendgrid不发送电子邮件
config.action_mailer.smtp_settings = {
:address => "smtp.sendgrid.net",
:port => "587",
:authentication => :plain,
:user_name => "<%= ENV['SENDGRID_USERNAME'] %>",
:password => "<%= ENV['SENDGRID_PASSWORD'] %>",
:domain => "mydomain.com",
:enable_starttls_auto => true
}
答
添加smtp_settings哈希之外你贴下面的一切:
config.action_mailer.default_url_options = { host: 'http://somedomain.com' }
此外,请确保您添加的环境变量您的用户名和密码的Heroku
012!+0
所有工作正常,我只是不知道发生在sendgrid上的错误,因为,heroku日志显示没有任何错误。 – chrisgeeq
你在电子邮件中发送图片或文本严格? – bkunzi01
严格的文字,这是一个确认电子邮件与设计@ bkunzi – chrisgeeq
也许这是一个问题与设计的秘密密钥需要设置为生产,但我不能肯定地说。 – bkunzi01