SyntaxFix
Write A Post
Hire A Developer
Questions
Set the User default credentials to true:
true
smtp.UseDefaultCredentials = True;
Before that, input your credential:
smtp.Credentials = new NetworkCredential(fromAddress, fromPassword);
This should work fine.