MailMessage mailMSG = new MailMessage();
SmtpClient myMail = new SmtpClient(yourSMTPhostaddress, your SMTP Port);
mailMSG.To.Add(new MailAddress(txtTo.Text));
mailMSG.From = new MailAddress(txtFrom.Text);
mailMSG.Subject = txtSubject.Text;
mailMSG.Body = txtContent.Value;
mailMSG.BodyEncoding = System.Text.Encoding.ASCII;
mailMSG.IsBodyHtml = true;
mailMSG.Priority = MailPriority.Normal;
myMail.Credentials = new NetworkCredential(specify MailUserName,specify MailPassword);
myMail.EnableSsl = true;
myMail.Send(mailMSG);