Hi,
Can someone please help me in how to check if both the mail message variables are same or not?
Thanks in Advance
Hi,
Can someone please help me in how to check if both the mail message variables are same or not?
Thanks in Advance
Welcome back to the forum!
I suppose you cannot directly compare it but can compare in parts by checking the
From, To, Cc, Subject, Body and attachment names.
Regards,
Aditya
You can check multiple things, from simple (but risky) ones, as they might generate false positives, to a bit more specific ones, but they might generate false negatives, youโll need to find the balance ![]()
Example of easy one - Compare mail1.Subject.ToString to mail2.Subject.ToString, and you could also compare mail1.Body to mail2.Body.
If you want to check not if the content is the same, but if indeed we are talking about the same mailmessage variable, you can use the Unique ID Header from both emails, as it should tell you if you have exactly the same mailmessage in both variables:
Hope this helps!
BR,
Ignasi
Welcome to the UiPath Community!
You can accomplish this using If Activity.
In Condition put like this.
mailMessage1 = mailMessage2
Thanks,
Ashok ![]()
Not sure if โ=โ would work for System.Net.Mail.MailMessages variables, might be wrong thoโฆ
BR,
Ignasi