【问题标题】:Email Signatures in Office365Office365 中的电子邮件签名
【发布时间】:2015-09-29 20:54:14
【问题描述】:

我想构建一个电子邮件签名应用程序。因为这些是主要功能

a) 显示电子邮件签名模板列表

b) 客户将选择任一模板并修改文本

c) 客户将通过点击确认按钮将该签名添加到他们的 office365 帐户

这里我的要求是我想知道如何通过 C# 代码中的 API 为 office365 帐户生成电子邮件签名?

【问题讨论】:

    标签: exchange-server office365


    【解决方案1】:
    Collection<PSObject> psresult;
    
    using (Runspace myRunSpace = RunspaceFactory.CreateRunspace())
    {
        myRunSpace.Open();
        PowerShell powershell = PowerShell.Create();
        powershell.Runspace = myRunSpace;
    
        using (powershell)
        {
            powershell.AddScript("$Username = 'username'; $Password = ConvertTo-SecureString 'password' -AsPlainText -Force; $cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password; $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri 'https://outlook.office365.com/powershell-liveid/' -Credential $cred -Authentication Basic -AllowRedirection; Import-PSSession $Session; Set-Mailboxmessageconfiguration -identity 'user' -signaturehtml 'SignatureInHTML' -autoaddsignature $true ; Remove-PSSession $session");
            psresult = powershell.Invoke();
        }
        powershell = null;
        myRunSpace.Close();
    }
    

    【讨论】:

    • 但是这段代码不会给 hotmail/outlook.com 添加签名。我如何也可以对它们应用签名?
    猜你喜欢
    • 2019-10-11
    • 2018-07-24
    • 2017-10-12
    • 1970-01-01
    • 1970-01-01
    • 2020-02-06
    • 1970-01-01
    • 1970-01-01
    • 2019-02-21
    相关资源
    最近更新 更多