Forum: Ruby on Rails ActionMailer in production vs development environments?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Max R. (Guest)
on 2006-01-05 09:55
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 => "<pre>" + email.encoded + "</pre>")

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?
Jarkko L. (Guest)
on 2006-01-05 14:51
(Received via mailing list)
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 => "<pre>" + email.encoded + "</pre>")

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
This topic is locked and can not be replied to.