User1624600859 posted
try this :-
string sender="uservalidemailaddress";
System.Net.Mail.MailMessage mMsg=new System.Net.Mail.MailMessage();
mMsg.To.Add("myvalidemailaddress");
System.Net.Mail.MailAddress mAdd=new System.Net.Mail.MailAddress(sender);
mMsg.From=mAdd;
mMsg.Subject="Email subject here";
mMsg.Body="Email text here";
mMsg.IsBodyHTML= true;
System.Net.NetworkCredential mNCred=new System.Net.NetworkCredential("userid","Password");
SmtpClient mSClnt=new SmtpClient();
mSClnt.UseDefaultCredentials = false;
mSClnt.Credentials = mNCred;
mSClnt.Host = "hostname here";
mSClnt.Send(mMsg);