Forum: Ruby on Rails Problem with mailer

3275da7fdbd73cb4e7956fd0d29164de?d=identicon&s=25 Paul Bergstrom (palb)
on 2011-03-09 18:45
I created a new mailer called Notifier. When I try that I get
"SystemStackError (stack level too deep):". Any ideas of what could be
wrong?
Fce8e97a4f558dcdd7d6a64f02c493a6?d=identicon&s=25 Vladimir Rybas (Guest)
on 2011-03-09 19:12
(Received via mailing list)
Post your mailer content here: http://pastie.org/
As well as stack trace.

"Stack level too deep" could mean you got an infinite loop. Maybe
you're calling method inside itself.
3275da7fdbd73cb4e7956fd0d29164de?d=identicon&s=25 Paul Bergstrom (palb)
on 2011-03-10 12:54
Vladimir Rybas wrote in post #986535:
> Post your mailer content here: http://pastie.org/
> As well as stack trace.
>
> "Stack level too deep" could mean you got an infinite loop. Maybe
> you're calling method inside itself.

I have a test method as:

def test
   Notifier.message().deliver
end

And a mailer as:


class Notifier < ActionMailer::Base
  default :from => "from@xxxxxx.info"

  def message()
     mail(:to => 'hello@xxxxx.com', :subject => "Test")
  end

end

Btw, I can have any name I want on the mailer, right? I thought of
having one mailer for the entire app.
3275da7fdbd73cb4e7956fd0d29164de?d=identicon&s=25 Paul Bergstrom (palb)
on 2011-03-10 13:37
Got it working. I tried with a new mailer, using the same name as a
controller and model, and  I changed :enable_starttls_auto => true to
false (as I got an ssl cert error).
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.