我在Heroku上运行了一个Rails 3.2应用程序,使用Action Mailer和Sendgrid发送单个交易电子邮件。目前,当应用程序发送电子邮件时,Sendgrid不会收到请求,要求发送11分钟。在收件箱中查看收到的电子邮件时,时间将显示收到的时间,但如果您打开电子邮件,则会有时间(提前11分钟)生成电子邮件请求。这就是我在production.rb中所拥有的:
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
}
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
我从未在Rails 4.0应用程序中遇到此问题,因此这是Rails 3.2的已知问题吗?
答案 0 :(得分:22)
我也有过这个。
在与他们的支持人员交谈后,故意拖延,将新账户纳入系统。
他们的系统需要“学习”你不是垃圾邮件发送者,才能消除延迟。
他们说它应该只是在“很短的时间内”推迟,除了发送合法的电子邮件之外没有别的办法可以删除它,等等。
答案 1 :(得分:0)
SendGrid文档中的一些答案:https://sendgrid.com/docs/Classroom/Send/When_Emails_Are_Sent/seeing_a_delay_with_your_first_few_sends.html
检查上面的shaunwhite关于获得支持以加快进程。