Why won't my ActionMailer work inside the controller?


#1

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(“removed_email_address@domain.invalid”,“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(“removed_email_address@domain.invalid”,“My subject”, “My
message”)
end

I never see the message. Something obvious I’m missing in the context
of running it in the controller?


#2

On May 28, 9:08 pm, Duane M. removed_email_address@domain.invalid
wrote:

def test
Emailer.deliver_message(“removed_email_address@domain.invalid”,“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