Like a good C# user, I use the [`MailAddress`](https://stackoverflow.com/questions/1903356/email-validation-regular-expression/1903368#1903368) object to validate email addresses.

A client of mine entered `john@gmail.` for his email, which was validated by `MailAddress`, and broke my software. I'd expect the code below to throw an exception, but it doesn't.

```
static void Main(string[] args)
{
    string addressmail = string.Empty;

    try
    {
        MailAddress mail = new MailAddress(@"john@gmail.");
        addressmail = mail.Address;
    }
    catch (FormatException)
    {
        // address is invalid
    }

    // address is valid
    Console.WriteLine(addressmail);
}

```

Do you know how to catch this kind of bogus mail address?