繁体   English   中英

用于生产的 Rails Action 邮件程序

[英]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

不过你必须注意:

  1. xxxxxxx_mailer.rb中将 `default from: "xxx@xxx.com" 设置为有效的电子邮件地址。
  2. 将此添加到您的 production.rb config.action_mailer.default_url_options = { :host => 'www.example.com' }

`

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM