2015-05-16 43 views
0

我想從我的應用程序發送電子郵件。我之前嘗試過使用sendgrid,但由於某種原因,它並沒有爲Gmail發送電子郵件。 這是我的配置。哪個heroku郵件附件支持Gmail?

config.app_domain = 'unstarv.herokuapp.com' 

# Email 
config.action_mailer.delivery_method = :smtp 
config.action_mailer.perform_deliveries = true 
config.action_mailer.default_url_options = { host: config.app_domain } 
config.action_mailer.smtp_settings = { 
address: 'smtp.gmail.com', 
port: '587', 
enable_starttls_auto: true, 
user_name: 'someuser', 
password: 'somepass', 
authentication: :plain, 
domain: 'unstarv.herokuapp.com' 

}

是否足夠的配置來發送郵件的Gmail的Heroku的?

回答

1

任何支持其授權方案的smtp客戶端理論上都應允許您通過gmail發送郵件。就Heroku插件而言,除了標準的Rail ActionMailer類之外,你並不需要任何東西。如果你選擇在Heroku之外的地方運行它,使用標準郵件程序也會使你的代碼更加便攜。

+0

我確實使用了sendgrid。我發了很多電子郵件,但其中只有一封是我收到的。花了很多時間才收到一封電子郵件。有沒有辦法讓電子郵件在Rails 4.1.8中立即發送? – codigomonstruo

+0

如果它離開你的應用程序,那麼它將留給電子郵件路由和發送神,它已經不在你手中。 – errata

+0

太棒了!那麼我還需要使用附加組件嗎? – codigomonstruo