【问题标题】:How to set catch all email in hMailServer如何在 hMailServer 中设置捕获所有电子邮件
【发布时间】:2013-10-14 13:21:22
【问题描述】:

我正在使用 .net 代码中的 hMail Interop 库与我的电子邮件服务器进行通信。是否可以从该库中设置捕获所有电子邮件服务器?

【问题讨论】:

    标签: hmail-server


    【解决方案1】:

    接口域指定属性 Postmaster。这是一个字符串,其中包含应用作域的全部内容的帐户地址。

    例子:

    public void SetDomainCatchAll(String domainName, String catchAllAddress)
    {
        String myUserName = "MyUserName";
        String myPassword = "MyPasword";
    
        // get hMailServer application instance
        Application app = new ApplicationClass();
        app.Authenticate(myUserName, myPassword);
    
        // check that domain and account exist
        Domain domain = app.Domains.get_ItemByName(domainName);
        Account account = domain.Accounts.get_ItemByAddress(catchAllAddress);
    
        // set postmaster and save changes
        domain.Postmaster = account.Address;
        domain.Save();
    }
    

    当然,这是非常粗略的代码,没有任何错误检查或任何内容,但我希望它能够向您展示您想了解的内容。如果您之后使用管理程序,您可以在域条目的高级选项卡上检查已成功设置全面地址。

    我在 hMailServer 版本 5.4-B1950 上对此进行了测试。

    【讨论】:

      猜你喜欢
      • 2014-01-25
      • 1970-01-01
      • 2014-08-02
      • 2017-09-18
      • 2016-04-16
      • 2016-01-29
      • 1970-01-01
      • 1970-01-01
      • 2014-01-26
      相关资源
      最近更新 更多