This is what I''m trying to do in my actionmailer class:
...
part "text/plain" do |p|
p.body = render_message("request.text.plain",
:email_request => email_request)
p.transfer_encoding = "base64"
end
if email_request.asset
attachment "#{email_request.content_type}" do |a|
a.body = File.read(email_request.asset)
a.filename = email_request.filename
end
end
...
If I remove the part "text/plain"... the email is sent with the
attachment and no body, (i was hoping that the body would be sent since
mailer is supposed to implicitly figure it out based on the name:
request.text.plain).
When I try to send an email as it is above, I get Internal 500 Server
Errors and 3 lines like this in my lighttpd.errro.log file:
2006-08-23 13:02:52: (mod_fastcgi.c.2430) unexpected end-of-file
(perhaps the fastcgi process died): pid: 5298 socket:
unix:/tmp/ruby-fastcgi.juR52.socket-1
2006-08-23 13:02:52: (mod_fastcgi.c.3168) child exited, pid: 5298
status: 1
2006-08-23 13:02:52: (mod_fastcgi.c.3215) response not received, request
sent: 218773 on socket: unix:/tmp/ruby-fastcgi.juR52.socket-1 for
/dispatch.fcgi , closing connection
Any ideas on the problem or ways to debug?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---
Ben Marini
2006-Aug-23 23:21 UTC
[Rails] Re: Problems with ActionMailer and multipart emails
*UDPATE*
This ended up working for me:
class ApplicationMailer < ActionMailer::Base
def request(email_request)
...
body :email_request => email_request
if email_request.asset
attachment email_request.content_type do |a|
a.body = File.read(email_request.asset)
a.filename = email_request.filename
end
end
end
end
I still don''t know why I wasn''t able to use the part() method
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---