1

I am trying to make an exception notifier. I installed the gem and put this code in production.rb:

config.action_mailer.delivery_method = :sendmail
  # Defaults to:
   config.action_mailer.sendmail_settings = {
     :location => '/usr/sbin/sendmail',
     :arguments => '-i -t'
   }

  config.action_mailer.perform_deliveries = true

  config.action_mailer.raise_delivery_errors = true

  config.middleware.use ExceptionNotifier,
      :email_prefix => "Error 500",
      :sender_address => %{"Notifier" <support@example.com>},
      :exception_recipients => %w{my@mail.com}

This doesn't throw any error, but it does not send the mail either. Help please.

sawa
  • 165,429
  • 45
  • 277
  • 381
Alejo Amiras
  • 67
  • 1
  • 8
  • Is your app running in production mode? What is in your MTA's log (postfix, exim4, ...)? Have you tried sending an exception notification in your terminal to see where the problem could be? – pdu May 08 '13 at 16:57
  • Yeah it is running on production mode. I've found the solution though. Thanks ! – Alejo Amiras May 08 '13 at 17:27

1 Answers1

1

I've replaced:

config.action_mailer.delivery_method = :sendmail
  # Defaults to:
   config.action_mailer.sendmail_settings = {
     :location => '/usr/sbin/sendmail',
     :arguments => '-i -t'
   }

With:

config.action_mailer.delivery_method = :smtp

config.action_mailer.smtp_settings = {
    :address => "smtp.gmail.com",
    :port => 587,
    :domain => "google.com",
    :user_name => "my@mail.com",
    :password => "password",
    :authentication => "plain",
    :enable_starttls_auto => true }

And it worked fine :D !

Alejo Amiras
  • 67
  • 1
  • 8