Forum: Ruby on Rails ActionMailer: Remove Content-ID from multipart emails

03151a1c9c2874b9acbc5538a3ea3387?d=identicon&s=25 Fernando Morgenstern (Guest)
on 2013-05-19 10:33
(Received via mailing list)
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@example.com', :subject => 'Test message', :from
=>
'sender@example.com') 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@FailPC.mail>

<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@FailPC.mail>

test2

----==_mimepart_51968c0793776_ae993feec08349d036897--


See the "Content-ID: <51968c0794e19_ae993feec08349d036917@FailPC.mail>"?
I
need to remove it.
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.