So i tried making an email sender and give my account info and this error showed up:
Cannot implicitly convert type ('string', 'string') to System.Net.ICredentialsByHost.
This is the code.
SmtpClient SmtpServer = new SmtpClient("smpt.gmail.com", 587);
SmtpServer.Credentials = ("username", "password"); # The email and password were lighted up with red
MailMessage Mail = new MailMessage();
Mail.From = new MailAddress("from");
I changed the email and password for obvious reasons.
You are trying to convert a ValueTuple
to ICredentialsByHost
. Need to construct a new NetworkCredential instance and set it in SmtpServer:
NetworkCredential credentials = new NetworkCredential("username", "password");
SmtpServer.Credentials = credentials;