MailMessage objMail = new MailMessage(); objMail.Subject = “邮件主题”; objMail.Body = “邮件正文”; string mfrom = txtFrom.Value; //从页面读取发送者地址 objMail.From = new MailAddress(mfrom); string mt = txtTo.Value; //从页面读取接收者地址 MailAddress ma = new MailAddress(mt); objMail.To.Add(ma); objMail.IsBodyHtml = true;//指示邮件