質問

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.

役に立ちましたか?

解決

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 !

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top