新浪需要验证的,你得加验证的代码还有,好象你的smtpserver也不对

解决方案 »

  1.   

    下面是在.NET Framework 1.1中发送邮件:
    (1.0不支持验证的)
    private void Page_Load(object sender, System.EventArgs e)
    {
           MailMessage mail = new MailMessage();
           mail.To = "[email protected]";
           mail.From = "[email protected]";
           mail.Subject = "this is a test email.";
           mail.Body = "Some text goes here";
           mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication
           mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "my_username_here"); //set your username here
          mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "super_secret"); //set your password here    SmtpMail.SmtpServer = "mail.mycompany.com";  //your real server goes here
        SmtpMail.Send( mail );
    }
    参考:http://www.systemwebmail.com/faq/3.8.aspx
      

  2.   

    将BodyFormat设置MailFormat.Html有什么好处?我设置它为MailFormat.Html,但实在Body中写下<font color=blue>test</font>,怎么说“客户端(txtBody="<font color='blue' >...")中检测到有潜在危险的 Request.Form 值”。我不能把HTML代码写到Body里,然后收件人打开时就直接显示成HTML?那Html格式有什么用啊?
      

  3.   

    好像默认的 SmtpServer 是本机的 SMTP 服务器。
      

  4.   

    将BodyFormat设置MailFormat.Html有什么好处?我设置它为MailFormat.Html,但实在Body中写下<font color=blue>test</font>,怎么说“客户端(txtBody="<font color='blue' >...")中检测到有潜在危险的 Request.Form 值”。我不能把HTML代码写到Body里,然后收件人打开时就直接显示成HTML?那Html格式有什么用啊?