C#邮件发送
1.首页要设置你的邮件账号开启了smtp Server
2.简单的3.5都显示过期的发送邮件代码
代码
MailMessage message = new MailMessage();
message.From = "120554323@qq.com";
message.BodyFormat = MailFormat.Html;
message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "120554323@qq.com");
message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "pengtaoo");
SmtpMail.SmtpServer = "smtp.qq.com";
message.To = "pt120554323@163.com";
message.Subject = "test";
message.Body = "teset";
message.BodyEncoding = Encoding.GetEncoding("gb2312");
SmtpMail.Send(message);
message.From = "120554323@qq.com";
message.BodyFormat = MailFormat.Html;
message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "120554323@qq.com");
message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "pengtaoo");
SmtpMail.SmtpServer = "smtp.qq.com";
message.To = "pt120554323@163.com";
message.Subject = "test";
message.Body = "teset";
message.BodyEncoding = Encoding.GetEncoding("gb2312");
SmtpMail.Send(message);