I'm trying to make a c# winform function so that when i press a button it sends an email to the email address given in a text box but there's something wrong with NetworkCredentials.
P.S I'm new to c# winforms

I'm trying to make a c# winform function so that when i press a button it sends an email to the email address given in a text box but there's something wrong with NetworkCredentials.
P.S I'm new to c# winforms

C# doesn't know NetworkCredential. You must specify the Namespace this class is defined in.
So either use System.Net.NetworkCredential or add using System.Net; to the top of your file so you don't have to type System.Net. everytime you want to use members of that namespace. This is ok until there have two classes with the same name. Then you must specify one of them explicitly.