使用QQ的SMTP发送邮件

MailAddress to = new MailAddress("mattins@qq.com");
                MailAddress from = new MailAddress("qdream@qq.com");
                MailMessage msg = new MailMessage(from,to);
                msg.Subject = "来自浏览者 "+email+" 的消息";
                msg.Body =content;
                SmtpClient sc = new SmtpClient();
                sc.Credentials = new NetworkCredential("qdream@qq.com","passworld");
                sc.Host = "smtp.qq.com";
                sc.Send(msg);
posted @ 2010-05-17 17:05  晨祷  阅读(1112)  评论(0编辑  收藏  举报