Using Amazon SES with Rails ActionMailer

前端 未结 10 1406
南旧
南旧 2020-12-04 09:42

What would be the best way to go about making ActionMailer send mail via Amazon SES in Rails 3?

Edit:

This is now a gem:

gem install amazon-         


        
10条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-04 10:04

    Configuring your Rails application with Amazon SES

    set action_mailer.perform_deliveries to true as it is set to false by default in the development/production environment

    config.action_mailer.perform_deliveries = true
    

    then paste this code in your development/production environment

    config.action_mailer.smtp_settings = {
      :address => ENV["SES_SMTP_ADDRESS"],
      :port => 587,
      :user_name => ENV["SES_SMTP_USERNAME"], 
      :password => ENV["SES_SMTP_PASSWORD"],
      :authentication => :login,
      :enable_starttls_auto => true
    }
    

提交回复
热议问题