MailMessage mailObj = new MailMessage();
mailObj.From = new MailAddress("799500957@qq.com"); //发送人邮箱地址
mailObj.To.Add("afsdfdsfds@qq.com"); //收件人邮箱地址
mailObj.Subject = "主题"; //主题
mailObj.Body = "正文内容"; //正文
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.qq.com"; //smtp服务器名称
smtp.UseDefaultCredentials = true;
smtp.Credentials = new NetworkCredential("发送人邮箱登录名", "发送人邮箱密码"); //发送人的登录名和密码
smtp.Send(mailObj);