shinji kuwayama
2006-Jan-05 07:55 UTC
[Rails] ActionMailer in production vs development environments?
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? -- Posted via http://www.ruby-forum.com/.
Jarkko Laine
2006-Jan-05 12:50 UTC
[Rails] ActionMailer in production vs development environments?
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 -- Jarkko Laine http://jlaine.net http://odesign.fi -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2363 bytes Desc: not available Url : http://wrath.rubyonrails.org/pipermail/rails/attachments/20060105/19787ddc/smime.bin