Note that two exceptions are listed: a WebException (to indicate that the name DoesNotExist could not be resolved) and a SmtpException. The code in the SmtpClient encountered and caught the WebException, wrapped it in a new SmtpException and threw that exception to indicate to your code that a problem occurred.