http://blog.csdn.net/zhzuo/archive/2004/07/12/39459.aspx

解决方案 »

  1.   

    System.Web.Mail.MailMessage mail=new MailMessage();
    mail.To="[email protected]";
    mail.From="[email protected]";
    mail.Subject="注册表";
    mail.Body="用户名"+this.TextBox1.Text+"密码"+this.TextBox2.Text;
    mail.Fields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"] = 1;
    mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "用户名"); //set your username here
    mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "密码"); //set your password here
                SmtpMail.SmtpServer="localhost";
                SmtpMail.Send(mail);
    Response.Write("<script language='javascript'>");
    Response.Write("alert('邮件发送成功');");
    Response.Write("</script>");