我想从 Heroku 上的 rails 应用程序发送电子邮件。由于 Heroku 不支持 SMTP,我使用外部 SMTP 服务器。
config/environments/production.rb 有以下几行。
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:address => 'mydomain.com',
:port => 587,
:user_name => "myusername",
:password => "password",
:authentication => :plain,
:enable_starttls_auto => true,
:openssl_verify_mode => 'none'
}
当我从“heroku 运行控制台”发送电子邮件时,它工作正常。但它不会从网站发送电子邮件。奇怪的是,“heroku logs --tail”显示“Sent mail to ...”。实际上电子邮件没有发送。
有人对这个问题有任何想法吗?
谢谢。
三孔