I''ve got a basic mailer setup and am simply trying to get a Hello message through. If I go into script/console and execute Emailer.deliver_message("myself-3Q2Tfjf0mexWk0Htik3J/w@public.gmane.org","My subject", "My message") it works fine. However, if I fire up a controller with a test method that invokes the same thing def test Emailer.deliver_message("myself-3Q2Tfjf0mexWk0Htik3J/w@public.gmane.org","My subject", "My message") end I never see the message. Something obvious I''m missing in the context of running it in the controller? -- Posted via http://www.ruby-forum.com/.
Frederick Cheung
2009-May-30 10:14 UTC
Re: Why won''t my ActionMailer work inside the controller?
On May 28, 9:08 pm, Duane Morin <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I''ve got a basic mailer setup and am simply trying to get a Hello > message through. If I go into script/console and execute > > Emailer.deliver_message("mys...-3Q2Tfjf0mexWk0Htik3J/w@public.gmane.org","My subject", "My > message") > > it works fine. > > However, if I fire up a controller with a test method that invokes the > same thing > > def test > Emailer.deliver_message("mys...-3Q2Tfjf0mexWk0Htik3J/w@public.gmane.org","My subject", "My > message") > end > > I never see the message. Something obvious I''m missing in the context > of running it in the controller?Shouldn''t be. Stupid question : are you sure the code is actually getting run? (the action name may be relevant here) Is the instance of rails serving your web request running with a different RAILS_ENV (ie potentially different action mailer settings) ? Fred> -- > Posted viahttp://www.ruby-forum.com/.