简体   繁体   中英

Rails Action mailer for production

I am using a Gmail account for my production environment as I can't afford paying for a mail host. I use the account to send emails to people using action mailer. Problem is my host is heroku and as you know it's not always the same exact server. So each time the server changes I have to go visit this http://www.google.com/accounts/DisplayUnlockCaptcha to enable dealing https://www.google.com/settings/security/lesssecureapps turned on.

Each time the dyno restarts I have to do that all over again. What are my options and what should I do? Thanks a lot

I have used sendgrid which is a heroku addon for a production mailer which works well with heroku.

Followed this tutorial: https://devcenter.heroku.com/articles/sendgrid

You have to take care though:

  1. In the xxxxxxx_mailer.rb set the `default from: "xxx@xxx.com" to a valid email address.
  2. Add this as well to your production.rb config.action_mailer.default_url_options = { :host => 'www.example.com' }

`

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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