Fernando Morgenstern
2013-May-18 12:52 UTC
ActionMailer: Remove Content-ID from multipart emails
Hi, Already asked this question in StackOverflow, but as not responses arrive, decided to give it a try here :) I''m using action mailer to send emails with both html and plain text version. Something like this: mail(:to => ''example-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org'', :subject => ''Test message'', :from => ''sender-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org'') do |format| format.text { render :text => ''test2'' } format.html { render :inline => ''<p>test</p>'' } end In my real application, i''m also not using templates because the content of the email comes entirely from the database. Is there a way to remove the Content-ID from the generated email? I ask this because i identified that this Content-ID cause some issues with email clients like Zimbra ( http://www.zimbra.com/ ). In this case, the *text part* is identified as an attachment. A sample email that is sent ( without all headers to reduce the size ): Subject: Test message Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="--==_mimepart_51968c0793776_ae993feec08349d036897"; charset=UTF-8 Content-Transfer-Encoding: 7bit ----==_mimepart_51968c0793776_ae993feec08349d036897 Date: Fri, 17 May 2013 16:59:03 -0300 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-ID: <51968c07954fb_ae993feec08349d0370d-l6jnvH79UUvwwNc1L8eyVw@public.gmane.org> <p>test</p> ----==_mimepart_51968c0793776_ae993feec08349d036897 Date: Fri, 17 May 2013 16:59:03 -0300 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-ID: <51968c0794e19_ae993feec08349d036917-l6jnvH79UUvwwNc1L8eyVw@public.gmane.org> test2 ----==_mimepart_51968c0793776_ae993feec08349d036897-- See the "Content-ID: <51968c0794e19_ae993feec08349d036917-l6jnvH79UUvwwNc1L8eyVw@public.gmane.org>"? I need to remove it. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/cb116e6a-b5c9-4cdb-9f43-868e477fecf8%40googlegroups.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.