How to check whether a E-mail address is in correct format?

Hi Guys, I am facing a challenge now.

So here’s the thing. We have a user list with contacts such as phone number and e-mail. The robot need to send e-mail to each of the users on the list. But we found that when SMTP activity faces a wrong-format address, the robot stops automatically and doesn’t report the position or record. Is there any method that I can test the format of e-mail addresses on the list before sending mails?

Thanks and Happy New Year!


You can IsMatch activity with a Regex expression to check the email is in valid format or not.

1 Like

You can also try creating a new MailAddress instance of your input e-mail. If the format is not correct it will fail and you will get an exception message.

Like so:
Create a variable of type System.Net.Mail.MailAddress.
Try giving it your input: myMailAddr = New MailAddress(addressToBeVerified)



Hi @Topi,

It is not failing for the email address which contains slash “/”.
Eg. “s/”

Email syntax accepts slash. For more info:

You can download Uipath.Email.Validation.Activities in manage packages created by saranpselvam. It contains Email validator activity that returns boolean type.


Use IsMatch to match Regular Expression pattern:

Tomatch email:

Pattern: \b[A-Z0-9._%±]+@[A-Z0-9.-]+.[A-Z]{2,}\b
RegexOption: Select checkboxes based on requirement

1 Like

hello @Tuhin_Samanta the regex pattern you have provided has accepting given kind of email id’s also, which is a invalid one the correct pattern is "([\w.-]+)@([\w.-]+).([a-zA-Z]+) "


1 Like

This is easy solution its working

Chethan P

Ya, actually this approach is not 100%. The .NET mail address tries to find an address, even if it’s invalid.