Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
65 lines (47 sloc) 2.08 KB


Splits the body of replied email messages into the actual new message and the included reply chain.


BodyParts.find_reply_in( valid raw email string, TMail or Mail object)


Given that you have the following raw email string stored in the variable message:

    MIME-Version: 1.0
    Received: by with HTTP; Tue, 22 Jun 2010 10:37:09 -0700 (PDT)
    In-Reply-To: <>
    References: <>
    Date: Tue, 22 Jun 2010 10:37:09 -0700
    Message-ID: <>
    Subject: Re: how is babby formed?
    From: Max Ogden <>
    To: Max Ogden <>
    Content-Type: multipart/alternative; boundary=0016361e87c2efdb680489a1de8e

    Content-Type: text/plain; charset=ISO-8859-1

    i saw on the news this mroing

    On Tue, Jun 22, 2010 at 10:36 AM, Max Ogden <> wrote:

    > how girl get pragnent?

    Content-Type: text/html; charset=ISO-8859-1
    Content-Transfer-Encoding: quoted-printable

    i saw on the news this mroing<br><br><div class=3D"gmail_quote">On Tue, Jun=
     22, 2010 at 10:36 AM, Max Ogden <span dir=3D"ltr">&lt;<a href=3D"mailto:mo="></a>&gt;</span> wrote:<br><blockquote class=
    =3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
    how girl get pragnent?


If you run BodyParts.find_reply_in message you will receive the following as output:

      :new_message    => "i saw on the news this mroing", 
      :rest_of_thread => "On Tue, Jun 22, 2010 at 10:36 AM, Max Ogden <> wrote:> how girl get pragnent?"


Copyright © 2010 Max Ogden. See LICENSE for details.