[英]Rails Action mailer for production
我在我的生產環境中使用 Gmail 帳戶,因為我負擔不起郵件主機的費用。 我使用該帳戶向使用 action mailer 的人發送電子郵件。 問題是我的主機是 heroku,正如您所知,它並不總是完全相同的服務器。 因此,每次服務器更改時,我都必須訪問此http://www.google.com/accounts/DisplayUnlockCaptcha以啟用交易https://www.google.com/settings/security/lesssecureapps 。
每次 dyno 重新啟動時,我都必須重新開始。 我有哪些選擇,我應該怎么做? 非常感謝
我使用了sendgrid
,它是用於生產郵件程序的 heroku 插件,可與 heroku 配合使用。
遵循本教程: https : //devcenter.heroku.com/articles/sendgrid
不過你必須注意:
xxxxxxx_mailer.rb
中將 `default from: "xxx@xxx.com" 設置為有效的電子郵件地址。config.action_mailer.default_url_options = { :host => 'www.example.com' }
`
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.