title: Unable to send email using Action Mailer in production
body: <p>I'm having some trouble sending email using ActionMailer with Gmail. I've attempted to use Mandrill but it's still not sending. When testing ActionMailer with gmail it works in development only but in production there seems to be an issue.</p>
  
  <p>I've tried multiple solutions but nothing seems to be working. I've tried setting up action mailer settings in environment.rb, swapped from gmail to mandrill. I can't seem to figure out what I'm missing.</p>
  
  <p>Let me know what you think. I've provided the code snippets below</p>
  
  <p>production.rb:</p>
  
  <pre><code>config.action_mailer.default_url_options = { :host =&gt; ENV["HEROKU_DOMAIN"] }
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.perform_deliveries = true
  config.action_mailer.raise_delivery_errors = false
  config.action_mailer.default :charset =&gt; "utf-8"
  config.action_mailer.smtp_settings = {
    address: "smtp.mandrillapp.com",
    port: 587,
    domain: ENV["HEROKU_DOMAIN"],
    authentication: "plain",
    enable_starttls_auto: true,
    user_name: ENV["HEROKU_USERNAME"],
    password: ENV["MANDRILL_KEY"]
  }
  </code></pre>
  
  <p>email_signup.rb:</p>
  
  <pre><code>class EmailSignup &lt; ApplicationMailer
    default from: "example@gmail.com"
  
    def sample_email(user)
      @user = user
  
      mail subject: "test", to: user.email
    end
  end
  </code></pre>
  
  <p>users_controller.rb:</p>
  
  <pre><code>def create
    @user = User.new(user_params)
  
    if @user.save
      @user.save
      EmailSignup.sample_email(@user).deliver
      redirect_to thanks_path
    else
      redirect_to root_path
    end
  end
  </code></pre>