I have a live app (livebytransit.com) and I recently switched to a custom domain instead of simply forwarding with cloaking. The domain is with Godaddy. Everything is looking good, except for my mailers no longer work!
Here is the error from heroku logs:
2012-01-03T22:36:17+00:00 app[web.1]: Rendered showing_mailer/showing_request.html.erb (0.5ms)
2012-01-03T22:36:17+00:00 app[web.1]:
2012-01-03T22:36:17+00:00 app[web.1]: Sent mail to info@livebytransit.com (213ms)
2012-01-03T22:36:17+00:00 app[web.1]: Completed 500 Internal Server Error in 242ms
2012-01-03T22:36:17+00:00 app[web.1]: EOFError (end of file reached):
2012-01-03T22:36:17+00:00 app[web.1]: app/controllers/showings_controller.rb:12:in `create'
From my production.rb config file:
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp
Initializer:
ActionMailer::Base.smtp_settings = {
:address => "smtpout.secureserver.net",
:port => 25,
:user_name => "username",
:password => "password",
:authentication => :login
}
Mailer:
class InviteeMailer < ActionMailer::Base
default from: "admin@livebytransit.com"
def send_invite(invitee)
@invitee = invitee
mail(:to => @invitee.email, :subject => "You have been Invited")
end
end
Finally the controller:
def create
@invitee = Invitee.new
@invitee.email = (params[:email])
@invitee.user_id = session[:user_id]
@invitee.save
InviteeMailer.send_invite(@invitee).deliver
redirect_to user_url(session[:user_id]), :notice => "Invitation Sent, thank you!"
end
The invitee is getting saved, but the mail does not go due to EOFError. This smells like a configuration problem to me, but I can't seem to figure it out, any thoughts would be mucho appreciated! Again, the mailer was working just fine until I switched to the custom domain.