title: How to set up mailer in Rails app for production environment on Heroku
body: <p>I need to use a mailer for sending out emails to users to set their passwords to the "recoverable" function of Devise and active admin. On the development environment I have done this by adding the following to these files:</p>
  
  <p>config/environments/development</p>
  
  <pre><code>#Added per active admin install instructions
  config.action_mailer.default_url_options = { :host =&gt; 'localhost:3000' }
  
  
  #These settings are for the sending out email for active admin and consequently the   devise mailer
  ActionMailer::Base.delivery_method = :smtp
  ActionMailer::Base.perform_deliveries = true
  ActionMailer::Base.raise_delivery_errors = true
  ActionMailer::Base.smtp_settings = 
  {
  
    :address            =&gt; 'smtp.gmail.com',
    :port               =&gt; 587,
    :domain             =&gt; 'gmail.com', #you can also use google.com
    :authentication     =&gt; :plain,
    :user_name          =&gt; 'XXXXX@gmail.com',
    :password           =&gt; 'XXXXXXX'
  }
  </code></pre>
  
  <p>How do I get the same functionality for the production environment? I want to deploy my app to Heroku. What files and code would I need to add?</p>