Tuesday

WebRequest Exception 401: The remote server returned an error: (401) Unauthorized.

it's required to add default credentials:
request.Credentials = CredentialCache.DefaultCredentials;
See this post for complete source.

No comments:

test smtp server with powershell

Send-MailMessage -SMTPServer smtp.domain.com -To [email protected] -From [email protected] -Subject "This is a test email" -Body ...