public static void sendmail(string tital,string content)
{
MailMessage mail = new MailMessage();
mail.To = "xiaoxing15@163.com";
mail.From = "hzg110@126.com";
mail.Subject = tital;
mail.Body = content;
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "hzg110"); //set your username here
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "1984110"); //set your password here
System.Web.Mail.SmtpMail.SmtpServer = "smtp.126.com";
SmtpMail.Send(mail);
}
NinetyNine学习
{
MailMessage mail = new MailMessage();
mail.To = "xiaoxing15@163.com";
mail.From = "hzg110@126.com";
mail.Subject = tital;
mail.Body = content;
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "hzg110"); //set your username here
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "1984110"); //set your password here
System.Web.Mail.SmtpMail.SmtpServer = "smtp.126.com";
SmtpMail.Send(mail);
}