我需要SmtpClient
在发送邮件之前验证实例中设置的用户名和密码。使用此代码:
SmtpClient client = new SmtpClient(host);
client.Credentials = new NetworkCredential(username,password);
client.UseDefaultCredentials = false;
// Here I need to verify the credentials(i.e. username and password)
client.Send(mail);
如何验证凭据标识的用户是否被允许连接和发送邮件?