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
Mark VermaatMark Vermaat 

Trying to create an email attachment stripper

I have a question.  I am trying to design a email attachment stripper.  For the sole reason of removing signiture images from emails that come in.  We used to have one for our system but with the amount of trafic we recieve, it was working overtime and keep causing errors.


I am fairly new to the apex language and would like any suggestions how to get it started.


Thanks in advance for any ideas.




Checout the email handler interface.  Lets you create an email service and gives you complete access to all message components, including attachments.

Mark VermaatMark Vermaat

Thanks Reid, I had a look at that before, but I work with a software and design company and we have a ton of attachments that still come in that we need.  I thought about this method, using the Apex Email Clases, I was more looking for a way to scan the email and if the attachement matches one that we have stored it would just take it off the email.  


I hope I expained it clearly,  I am still working with what you mentioned but is there a way to use a compareTo statement? 





It would probably only be able to compare the doc name, but what you want is to do a diff on the contents.

I don't really know how to do that.

I would probably start by

a) rejected insignificant attachments -- email footer stuff

b) storing significant attachments

c) do some post storage comparison in another routing