How to compare e-mail messages without using the body of the message?
For example:
- John sent a message to Mary and "save" this message in my addin.
- Both have the same addin.
- When Mary receives the message, this message must be categorized because John already "save" the message.
How to identify that the message that Mary received is the same as the message that John sent("save") without using the body of the message?
Currently this is working as follows, a HASH is made with the following information:
- Sender
- Addressee
- Subject
- Message Body Text
This Hash is stored in the database, when Mary's Outlook triggers the event of the new message, a HASH with the same information is generated and compared in the database to see if it should be categorized or not.
The problem is that depending on the body size of the message, it is not performatic, it takes a long time to get the body of the message through the MailItem.Body property.
The purpose of not using the body of the message is solely to increase performance.
public string GetAssinatura(Outlook.MailItem email)
{
try
{
string corpoEmail = email.Body;//this is not performatic with big messages
var hash = GenerateHash(corpoEmail);
}
}
Conversation participants can reply or forward the message, so Outlook and most of the most frequently used e-mail clients change the subject to a default, Re: Subject for example. Therefore, it is not possible to only have a hash of the participants and the subject.