public bool ReceiveEmail()
{
try
{
#region 邮件内容设置
//MailAddress MFrom = new MailAddress("aa@sohu.com");
//MailAddress MTo = new MailAddress("bb@sohu.com");
System.Net.Mail.MailMessage MailM = new System.Net.Mail.MailMessage("aa@sohu.com", "bb@sohu.com");
MailM.Subject = "zhuti";
MailM.Body = "neirong"
MailM.IsBodyHtml = true;
MailM.BodyEncoding = System.Text.Encoding.GetEncoding("GB2312");
#endregion
#region Smtp设置
SmtpClient SmtpC = new SmtpClient("smtp.sohu.com", 25);
SmtpC.UseDefaultCredentials = false;
SmtpC.Credentials = new System.Net.NetworkCredential("aa@sohu.com", "iloveyou");
SmtpC.DeliveryMethod = SmtpDeliveryMethod.Network;
SmtpC.Send(MailM);
#endregion
}
catch (Exception err)
{
return false;
}
}