本帖最后由 nociyy 于 2010-08-31 00:03:28 编辑

解决方案 »

  1.   


      [WebMethod]
    public string sendMessage(string from, string to, string subject, string payload, string customFields)
    {
    string result="";
    try
    {
    GeneralMailService general = GeneralMailService.getInstance();
    general.sendMessage(from, to, subject, payload, customFields);
    result="1";
    }
    catch(Exception e)
    {
    //return "调用发送邮件方法时出错!";
    result=e.ToString();
    }
    finally
    {
    return result;
    }
    }
      

  2.   

    使用VS2005 自带的WebServer的运行账户是当前的登录账户
    iis里使用的是匿名帐号,权限级别不同。你可以在iis里将匿名访问去掉,使用管理员帐号进行测试
      

  3.   

    1、发布后的目录是否包含InjectionAPI.dll
    2、发布后的站点是否允许匿名访问
      

  4.   

    你可以在iis里将匿名访问去掉
      

  5.   

    检查操作权限
    DLL是否存在
      

  6.   

    谢谢大家的回复! 问题是暂时解决了, 我换成了 Apache Server, 就可以正常发送邮件了。至于IIS为什么会报错还是没有答案。刚刚试了一下把IIS的“匿名访问” 去掉,换成“集成Windows身份验证”也不行的。因为时间紧就暂时把IIS踢开吧! 用 Apache Server 其实也蛮好的!