How can you check for a valid email address in Powershell?
I've googled this and most people say to use $toadr = new-object net.mail.mailaddress($to)
with a try/catch.
However this doesn't check for .com etc at the end of the email.
Eg. $toadr = new-object net.mail.mailaddress("test@mailcom")
doesn't throw an exception even though there is no dot before com.