/// <summary>
/// C#发送邮件(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 + "@163.com"));
MyMail.Subject = Mailtitle;
MyMail.Body = MailCon;
MyMail.IsBodyHtml = false;
SmtpClient smtpclient = new SmtpClient();
smtpclient.DeliveryMethod = SmtpDeliveryMethod.Network;
smtpclient.Host = "smtp.163.com";
smtpclient.Credentials = new System.Net.NetworkCredential(MailFrom, MailPwd);
smtpclient.Send(MyMail);
}
/// C#发送邮件(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 + "@163.com"));
MyMail.Subject = Mailtitle;
MyMail.Body = MailCon;
MyMail.IsBodyHtml = false;
SmtpClient smtpclient = new SmtpClient();
smtpclient.DeliveryMethod = SmtpDeliveryMethod.Network;
smtpclient.Host = "smtp.163.com";
smtpclient.Credentials = new System.Net.NetworkCredential(MailFrom, MailPwd);
smtpclient.Send(MyMail);
}