I am unable to send the mail using smtp client. here is the code:
SmtpClient client=new SmtpClient(\"Host\");
client.Credentials=new NetworkCredential(\"username
The short answer : Do not use .net the internal SMTP client class - use MailKit.
The long answer :
[System.Obsolete("SmtpClient and its network of types are poorly designed, we strongly recommend you use https://github.com/jstedfast/MailKit and https://github.com/jstedfast/MimeKit instead")] public class SmtpClient : IDisposable
I intentionally did not copy-paste the examples from the docs here because the documentation may change over time and it is better to read .