方法一。利用.NET自带的邮件类来实现 smtp 邮件传输协议 CDO 协助数据对象 切忌 用QQ做服务器 不行 方法:引用System.Web.Mail命名空间,然后在发送时执行如下代码: MailMessage email = new MailMessage(); email.From = "发件人的Email地址"; email.To = "收件人的Email地址"; email.Subject = "找回密码"; //邮件的主题 email.Body = "您的密码是:dkdkdk"; //邮件的正文内容 MailAttachment att = new MailAttachment("c://test.txt",MailEncoding.Base64); //附件 email.Fields.Add(@"http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //表示基本验证 email.Fields.Add(@"http://schemas.microsoft.com/cdo/configuration/sendusername", "abc"); //发件人的Email登录用户名 email.Fields.Add(@"http://schemas.microsoft.com/cdo/configuration/sendpassword", "abc"); //发件人的Email登录密码 SmtpMail.SmtpServer = "smtp.126.com"; //发送邮件服务器地址 try { SmtpMail.Send(email); //发送邮件 } catch { Response.Write("<mce:script type="text/javascript"><!-- window.alert('"+"发生故障,邮件没有发送成功"+"') // --></mce:script> "); return; } Response.Write("<mce:script type="text/javascript"><!-- window.alert('"+"邮件发送成功"+"') // --></mce:script>"); 答案补充 ///方法二 try { System.Web.Mail.MailMessage mailmsg = new System.Web.Mail.MailMessage(); mailmsg.From = "xifenglc@sohu.com"; mailmsg.To = "liuchao_21458@163.com"; mailmsg.Body = "测ffdsafdsfdsafds试"; mailmsg.Subject = "fdasfdsafdas"; mailmsg.BodyEncoding=System.Text.Encoding.UTF8; mailmsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); mailmsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername","xifenglc"); mailmsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "liuchao850501"); System.Web.Mail.SmtpMail.SmtpServer ="smtp.sohu.com"; System.Web.Mail.SmtpMail.Send(mailmsg); Response.Write("OK"); } catch { Response.Write("error"); }