//发送邮件
public void SendMail(string to, string subject,string content)
{
try
{
string fromEmail = HttpContext.Current.Session["LoginUserName"].ToString() + "<public@dfhh.net.cn>";
string toEmail = to;
string IP = HttpContext.Current.Request.UserHostAddress;
System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient("mail.163.com");
client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCredential("public", "public");
client.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(fromEmail, toEmail, subject, content);
message.BodyEncoding = System.Text.Encoding.Default;
message.IsBodyHtml = true;
client.Send(message);
}
catch
{
}
}