感谢您使用微软产品。关于这个问题,同时,您可以在下面的微软中国社区的网页上面得到一篇很不错的文章,它详细介绍了如何在ASP.NET中发送EMIL.(包括支持SMTP验证):http://www.microsoft.com/china/community/article.asp?oBODY=TechZone/TechArticle/TechDoc/sendmail&oXSLT=TechZone/TechArticle/TechContent希望对您有所帮助。
 
-微软全球技术中心  -zgh
 
本贴子以“现状”提供且没有任何担保,同时也没有授予任何权利。具体事项可参见使用条款(http://support.microsoft.com/directory/worldwide/zh-cn/community/terms_chs.asp)。
为了为您创建更好的讨论环境,请参加我们的用户满意度调查(http://support.microsoft.com/directory/worldwide/zh-cn/community/survey.asp?key=(S,49854782))。

解决方案 »

  1.   

    第一种方法:在iis里启动你调试那台机器的smtp虚拟服务器
    SmtpMail.SmtpServer ="127.0.0.1"; 
    第二种方法:
    找一个没有设置认证的smtp
    SmtpMail.SmtpServer ="xxx.com";我现在找了一个,不能在这公布.不然那家服务器还不挺了?
      

  2.   

    Configuration conf=new ConfigurationClass();
       
    conf.Fields[CdoConfiguration.cdoSendUsingMethod].Value=CdoSendUsing.cdoSendUsingPort;
    conf.Fields[CdoConfiguration.cdoSMTPServer].Value="smtp.21cn.com";
    conf.Fields[CdoConfiguration.cdoSMTPServerPort].Value=25;
    conf.Fields[CdoConfiguration.cdoSMTPAccountName].Value="hydnoahark";
    conf.Fields[CdoConfiguration.cdoSendUserReplyEmailAddress].Value="\"c_zc\" <[email protected]>";
    conf.Fields[CdoConfiguration.cdoSendEmailAddress].Value="\"c_zc\" <[email protected]>";
    conf.Fields[CdoConfiguration.cdoSMTPAuthenticate].Value=CdoProtocolsAuthentication.cdoBasic;
    conf.Fields[CdoConfiguration.cdoSendUserName].Value="c_zc";
    conf.Fields[CdoConfiguration.cdoSendPassword].Value="12345678";
        
    conf.Fields.Update(); MessageClass msg=new MessageClass();
    msg.Configuration=conf; msg.To="[email protected]";
    msg.Subject="收到否";
    msg.TextBody="It's test";
    msg.From="[email protected]";
    msg.Send();   
    需要引用CDO(Microsoft CDO For Exchange 2000 Library),注意引用别出错了。以上代码经测试成功。
    另:其中的示例密码已更改:)