I can\'t understand why this code is not working. I get an error saying property can not be assigned
MailMessage mail = new MailMessage(); SmtpClient client
If you want to have your email and password not appear in your code and want your company email client server to use your windows credentials use below.
client.Credentials = CredentialCache.DefaultNetworkCredentials;
Source