System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage();
msg.To.Add(TextBox1.Text);
msg.Subject = "Forgot password.";
msg.From = new System.Net.Mail.MailAddress("autoemail@xyz.com");
string passwrd=" ";
msg.Body += "Your user ID is " + TextBox1.Text+" and password is +"passwrd;
msg.Body += "Have a great day!\n";
msg.Body += " \n ";
msg.Body += "-Team\n XYZ services!";
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("localhost");
smtp.Send(msg);
Happy coding.