I'd like to use Amazon SES to send mail from my application deployed on Heroku
Currently I am able to send mail from localhost, but not able to send mails from my application deployed on HEROKU
I'd like to use Amazon SES to send mail from my application deployed on Heroku
Currently I am able to send mail from localhost, but not able to send mails from my application deployed on HEROKU
There's no reason why it cannot work. Basically the steps are as follow
update your credentials to Heroku
heroku config:set AWS_ACCESS_KEY_ID=xxx AWS_SECRET_ACCESS_KEY=yyy AWS_REGION=region
update your Gemfile
gem 'aws-sdk', '~> 2'
gem 'aws-sdk-rails'
Then bundle install
to take into effect
configure Amazon SES to be your mail application, update config/environments/production.rb
aws_credentials = Aws::Credentials.new(ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_ACCESS_KEY_ID'])
Aws::Rails.add_action_mailer_delivery_method(:aws_ses, credentials: aws_credentials, region: ENV['AWS_REGION'])
config.action_mailer.delivery_method = :aws_ses
Then it should work