MailMessage mailMsg = new MailMessage();//两个类,别混了,要引入System.Net这个Assembly
mailMsg.From = new MailAddress("**@126.com", "***");//源邮件地址
mailMsg.To.Add(new MailAddress("***", "***"));//目的邮件地址。可以有多个收件人
mailMsg.Subject = "你好 我发的!";//发送邮件的标题
mailMsg.Body = "<a href='http://www.baidu.com'>百度的连接qq邮箱测试</a>";//发送邮件的内容
mailMsg.IsBodyHtml = true;
SmtpClient client = new SmtpClient("smtp.126.com");//smtp.163.com,smtp.qq.com
client.Credentials = new NetworkCredential("***", "****");//发送人账号密码
client.Send(mailMsg);//排队发送邮件.