Search code examples
ruby-on-railsdevisemailer

Devise Mailer doesn't work in production


I have a problem. My Devise Mailer seems to work just fine in development. I get in my log that the confirmation messages are sent to respective mails when I try to signuup. But when I try to run the server in the production mode to see if the messages will actually be sent, I get this error:

    Errno::ECONNREFUSED in Devise::RegistrationsController#create
    No connection could be made because the target machine actively refused it. - connect(2)

But, when I add this line to my production.rb:

    config.action_mailer.delivery_method = :test

I can sign up, and I get in the log that the message is sent.

If anyone could elaborate, I would be most thankful.


Solution

  • Fix was to play around with the smtp settings. Thank you @nickcen