邮件发送
//using System.Net.Mail;
//添加邮件服务器
SmtpClient client = new SmtpClient("smtp.qq.com",25);
//身份认证信息是否一起发送
client.UseDefaultCredentials = false;
//指定发送人的用户名和密码
client.Credentials = new System.Net.NetworkCredential("674355741@qq.com", "ch8512845..");
//指定如何处理邮件
client.DeliveryMethod = SmtpDeliveryMethod.Network;
//指定需要发送的内容和发送给谁
MailMessage msg = new MailMessage("674355741@qq.com", "13416309@qq.com", "123", "测试邮件");
//指定邮件文本编码格式
msg.BodyEncoding = System.Text.Encoding.UTF8;
//发送邮件
client.Send(msg);
MessageBox.Show("邮件发送成功!");