/// <summary>
/// 发送邮箱163
/// </summary>
/// <param name="MailFrom">邮箱用户名</param>
/// <param name="MailTo">接收人用户名</param>
/// <param name="MailPwd">邮箱用户密码</param>
/// <param name="Mailtitle">邮件标题</param>
/// <param name="MailCon">邮件内容</param>
public void MailSend(string MailFrom, string MailTo, string MailPwd, string Mailtitle, string MailCon)
{
MailMessage MyMail = new MailMessage();
MyMail.From = new MailAddress(MailFrom + "@163.com", "");
MyMail.To.Add(new MailAddress(MailTo));
MyMail.Subject = Mailtitle;
MyMail.SubjectEncoding = System.Text.Encoding.UTF8;
MyMail.Body = MailCon;
MyMail.BodyEncoding = System.Text.Encoding.UTF8;
MyMail.IsBodyHtml = false;
SmtpClient smtp = new SmtpClient();
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
smtp.Host = "smtp.163.com";
smtp.Credentials = new System.Net.NetworkCredential(MailFrom, MailPwd);
smtp.Send(MyMail);
}
以上代码是可以运行的本人以测试过