function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Remove main email body and previous bodies of all replies in an email service

Hi Experts,

I have a problem with email service in apex. When I reply to the salesforce generated email address, then in my email service handler the body contains all the previous replies and main email body(when the email was sent first time) along with the current reply.


    Test Notessssss......
    On Mon, May 4, 2015 at 11:58 AM, Pankaj <> wrote:

My reply body is Test Notesssssss..... only. But in email service handler I am getting the previous one as well.

Can someone suggest me how we can avoid the previous thread bodies?

Thanks in advance!
I don't think there is a ready-to-use functionliaty in Apex that does that. You can do it manually though. Have a look at this article, this might help:

Other work around will be to have limitation on the number of chars to process.

For Example, 
email.plainTextBody.substring(0, 1000); //process only 1000 chars
Arun TyagiArun Tyagi
Hello Pankaj
I make a email template .when i m calling on visulforce page .it showing email template or email template details both .but i want only email template not email template details User-added image
pankaj kumar 55pankaj kumar 55
hi pankaj,

have you got the it solved..can u plz help me how you did this..
Aparna SFDCAparna SFDC
Hi Pankaj,
Have you got the answer?