How to filter duplicate emails

Hi @Milo_Soderberg ,

Could you Check with the below Expression to Filter out the Emails based on Duplicate Subjects :

The below is to be performed after receiving the mails.

mailMessages = mailMessages.GroupBy(Function(x)x.Subject).Select(Function(x)x.First).ToList

Where mailMessages is a variable of type List(Of MailMessage)