ActionMailer in production vs development environments?


#1

I’m using ActionMailer to write an email message; for the time being I’m
creating an email object, but rendering it in the browser instead of
sending it. I have code like this:

email = PasswordMailer.deliver_confirm(@member)
render(:text => “

” + email.encoded + “
”)

This works great in the development environment but throws a Rails error
in production. Why would it work in one environment and not the other?


#2

On 5.1.2006, at 9.55, shinji kuwayama wrote:

I’m using ActionMailer to write an email message; for the time
being I’m
creating an email object, but rendering it in the browser instead of
sending it. I have code like this:

email = PasswordMailer.deliver_confirm(@member)
render(:text => “

” + email.encoded + “
”)

Deliver will deliver the mail object directly. Maybe you have
delivering turned off in the dev mode by the configuration and it
doesn’t therefore hit the place where the error is thrown. Could you
post the relevant part of the production.log so it would be easier to
track the error? It might just be that ActionMailer can’t reach your
smtp server.

You should use create_confirm instead if you just wanted to create
the mail object and not deliver it.

//jarkko