+ Start a Discussion
Pankaj_GanwaniPankaj_Ganwani 

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.

Like:

    Test Notessssss......
    
    On Mon, May 4, 2015 at 11:58 AM, Pankaj <pankaj@gmail.com> wrote:
    Testjfdsfjdklsflkdsjflksdfjklsdfjlkdsfjsdklfj
    fjdslkfjsdklfjsdlkfjlsdkfjsdklfjdklsj

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!
Hargobind_SinghHargobind_Singh
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:

http://stackoverflow.com/questions/1372694/strip-signatures-and-replies-from-emails

 
BalajiRanganathanBalajiRanganathan
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 answer..is it solved..can u plz help me how you did this..