发送邮件给邮箱代码:
MailMessage mailMsg=new MailMessage();// mailMsg.To.From = new MailAddress("wang_itcast@126.com","王承伟");//发件人 mailMsg.To.Add(new MailAddress("wang_itcast@126.com","王承伟"));//收件人,可以new多个 mailMsg.Subject="Tai Xie le!"; SmtpCliect client=new SmtpClient("smtp.126.com");//smtp.163.com,smtp.qq.com client.Credentials=new NetWorkCredential("wang_itcast","wangchengwei"); client.Send(mailMsg);