把这句注释掉:
SmtpMail.SmtpServer = "smtp.163.com"smtpmail是通过调用windows2000的虚拟smtp服务器完成邮件发送的,虽然提供了SmtpMail.SmtpServer这样的属性,但是没有提供验证的相关属性,也就是只能通过不加验证的smtp服务器发送邮件,而现在为了避免垃圾邮件的泛滥,大部分邮件服务器都是用了验证,也就是说,你如果没有正确的身份,无法匿名发送邮件,而即使你的邮件服务器无需验证,也可能出现邮件无法送达的现象,因为很多pop3服务器不接受没有验证就发送的邮件

解决方案 »

  1.   

    改用Socket编写发邮件的程序
    自己实现验证部份的代码
      

  2.   

    www.life369.com 助手-->邮件发送
      

  3.   

    增加发件认证。。
    mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", smtpUserName); mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", smtpUserPwd); 
      

  4.   

    可以调用cdosys.dll
    详情参看http://www.chinabs.net/aspnet/default.asp?infoid=50
      

  5.   

    如果使用默认的SMTP服务器,需要打开WIN2K服务中的Smtp服务,才可以通过本机的SMTP发邮件,当然这个SMTP不需要认证如果需要使用其它的需要认证的SMTP,可以试试kingastar的方法,其中mail是MailMessage对象
      

  6.   

    Kingstar的方法不行啊,Hotmail还是没法收到发出的邮件。
      

  7.   

    CDO是Collaboration Data Objects的简称,它是一组高层的COM对象集合,并经历了好几个版本的演化,现在在Windows2000和Exchange2000中使用的都是CDO2.0的版本(分别为cdosys.dll和cdoex.dll)。CDOSYS构建在SMTP协议和NNTP协议之上,并且作为Windows2000 Server的组件被安装,您可以在系统目录(如c:\winnt或c:\windows)的system32子目录中找到它(cdosys.dll)。
      CDO组件相对于先前介绍的SmtpMail对象功能更为丰富,并提供了一些SmtpMail类所没有提供的功能,如通过需要认证的SMTP服务器发送邮件等。public void CDOsendMail()
    {
    try
    {    
    CDO.Message oMsg = new CDO.Message();
        
    oMsg.From = "[email protected]";
    oMsg.To = "[email protected]";
    oMsg.Subject = this.TBsubject.Text.Trim();
                     
    oMsg.HTMLBody = "<html><body>"+this.TBbody.Text.Trim()+"</body></html>"; CDO.IConfiguration iConfg = oMsg.Configuration;
    ADODB.Fields oFields = iConfg.Fields;
              
    oFields["http://schemas.microsoft.com/cdo/configuration/sendusing"].Value=2;
    oFields["http://schemas.microsoft.com/cdo/configuration/sendemailaddress"].Value="[email protected]"; //sender mail
    oFields["http://schemas.microsoft.com/cdo/configuration/smtpaccountname"].Value="[email protected]"; //email account
    oFields["http://schemas.microsoft.com/cdo/configuration/sendusername"].Value="username";
    oFields["http://schemas.microsoft.com/cdo/configuration/sendpassword"].Value="password"; 
    oFields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"].Value=1;
    //value=0 代表Anonymous验证方式(不需要验证)
    //value=1 代表Basic验证方式(使用basic (clear-text) authentication. 
    //The configuration sendusername/sendpassword or postusername/postpassword fields are used to specify credentials.)
    //Value=2 代表NTLM验证方式(Secure Password Authentication in Microsoft Outlook Express)
    oFields["http://schemas.microsoft.com/cdo/configuration/languagecode"].Value=0x0804;
    oFields["http://schemas.microsoft.com/cdo/configuration/smtpserver"].Value="pop3.163.com"; oFields.Update();
    oMsg.BodyPart.Charset="gb2312";
    oMsg.HTMLBodyPart.Charset="gb2312";  oMsg.Send();
    oMsg = null;
    }   
    catch (Exception e)
    {
    string strText=e.Message;
    strText = strText.Replace("\r\n","\\r\\n");
    Page.RegisterStartupScript("","<script langue=javascript>"+"alert('"+ strText +"');</script>");
    }
    }
      

  8.   

    '以下是完整的代码Dim email As New System.Web.Mail.MailMessage
    email.To = "[email protected]"
    email.From = "[email protected]"
    email.Body = "MessageText"
    email.Subject = "SubjectText"
    email.BodyFormat = Web.Mail.MailFormat.Textemail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1")
    '将以下三行中中的,第2个参数,设为你的smtp相应值,即可
    email.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", "smtp.163.net")
    email.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "smtpuser")
    email.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "password")System.Web.Mail.SmtpMail.Send(email)