【问题标题】:OWA Signature Update with Exchange Web Services使用 Exchange Web 服务进行 OWA 签名更新
【发布时间】:2013-01-11 04:54:37
【问题描述】:

我们正在使用 Exchange Web 服务在 Outlook Web Access 中设置用户签名。效果很好,我们在选项>设置下看到签名,并且选中了“在我发送的消息中自动包含我的签名”复选框。我们还以编程方式设置。

但是,当用户在 OWA 中创建新电子邮件时,签名不会显示。解决此问题的方法是转到选项>设置,取消选中“在我发送的消息中自动包含我的签名”复选框,保存,再次选中该复选框并保存。

我们用来设置签名的代码如下所示:

Folder rootFolder;
UserConfiguration OWAConfig;
rootFolder = Folder.Bind(service, WellKnownFolderName.Root);
OWAConfig = UserConfiguration.Bind(service, "OWA.UserOptions",rootFolder.ParentFolderId, UserConfigurationProperties.All);

OWAConfig.Dictionary["signaturehtml"] = "Hello World";
OWAConfig.Dictionary["autoaddsignature"] = "True";
OWAConfig.Update();

知道如何解决这个问题吗?

【问题讨论】:

    标签: exchangewebservices exchange-server-2010 office365


    【解决方案1】:

    我有一些旧代码可以做同样的事情,而且运行良好。我已经粘贴了下面的代码。我的代码和你的代码有一些细微的差别。我不确定它们是否会有所作为,但您可能想尝试一下。这是我的代码的摘录,其中的差异用注释突出显示:

    private void SetSettingValue(UserConfiguration owaConfig, string propName, object propValue)
    {
        if (owaConfig.Dictionary.ContainsKey(propName))
        {
            owaConfig.Dictionary[propName] = propValue;
        }
        else
        {
            // Adds a key if it does not explicitly exist.
            // I am not sure if it makes a difference.
            owaConfig.Dictionary.Add(propName, propValue);
        }
    }
    
    public void AddSignature()
    {
       // Extract
        UserConfiguration OWAConfig = UserConfiguration.Bind(
            service, 
            "OWA.UserOptions", 
            WellKnownFolderName.Root, // Binding to Root and not Root.ParentFolderId.
            UserConfigurationProperties.Dictionary // Binds to Dictionary and not to All.
            );
    
        SetSettingValue(OWAConfig, "autoaddsignature", true);
        SetSettingValue(OWAConfig, "signaturehtml", html);
    
        OWAConfig.Update();
    }
    

    【讨论】:

    • 谢谢,但我发布的代码是我们使用的代码的简化版本,我们会在设置创建或更新之前检查属性是否存在。这部分工作正常,它在 OWA 中的签名刷新是个问题。
    • 我没有想法。
    • 问题是我将值设置为“True”应该像布尔值一样为真。您的代码是 100%。
    猜你喜欢
    • 2017-08-07
    • 2021-12-14
    • 2012-08-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-24
    • 1970-01-01
    相关资源
    最近更新 更多