MailAddress from = new MailAddress("swshq781@163.com");
MailAddress to = new MailAddress(txtTo.Text.ToString().Trim());
MailMessage message = new MailMessage(from, to);
//message.Subject = "ShoppingCity取回密码";
message.Subject = txtSubject.Text.ToString().Trim();
message.IsBodyHtml = true;
//message.Body = name + ",您的密码是:" + pwd;
message.Body = txtBody.Text.ToString().Trim();
message.BodyEncoding = Encoding.GetEncoding("GB2312");
SmtpClient client = new SmtpClient();
client.Host = "smtp.163.com";
client.UseDefaultCredentials = true;
client.Credentials = new NetworkCredential("swshq781@163.com", "111111");
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.Send(message);