Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 4.0 如何在Microsoft exchange服务中设置/访问outlook DoNotForward属性_C# 4.0_Outlook_Smtp_Exchangewebservices_Exchange Server 2010 - Fatal编程技术网

C# 4.0 如何在Microsoft exchange服务中设置/访问outlook DoNotForward属性

C# 4.0 如何在Microsoft exchange服务中设置/访问outlook DoNotForward属性,c#-4.0,outlook,smtp,exchangewebservices,exchange-server-2010,C# 4.0,Outlook,Smtp,Exchangewebservices,Exchange Server 2010,在outlook中访问发送电子邮件时要使用的选项。 我需要在Microsoft exchange服务代码中设置不转发EmailMessage对象的权限,但我无法将其设置为true ServicePointManager.ServerCertificateValidationCallback = CertificateValidationCallBack; ExchangeService service = new ExchangeService(Exchang

在outlook中访问发送电子邮件时要使用的选项。

我需要在Microsoft exchange服务代码中设置不转发EmailMessage对象的权限,但我无法将其设置为true

        ServicePointManager.ServerCertificateValidationCallback = CertificateValidationCallBack;

        ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP2);
        service.Credentials = new WebCredentials("abc", "xyz", "bbb");

        service.AutodiscoverUrl("xyz@abc.com", RedirectionUrlValidationCallback);
        //service.Url = new System.Uri("https://exserver.yourdomain.com/EWS/Exchange.asmx");

        // Get the GUID for the property set.
        Guid MyPropertySetId = new Guid("{C11FF724-AA03-4555-9952-8FA248A11C3E}");

        // Create a definition for the extended property.
        ExtendedPropertyDefinition extendedPropertyDefinition = new ExtendedPropertyDefinition(MyPropertySetId, 1, MapiPropertyType.Integer);
        // Add the extended property to an e-mail message object named "message".
       // message.SetExtendedProperty(extendedPropertyDefinition, DateTime.Now.AddDays(2).ToString());

        // Save the e-mail message.
        //message.SendAndSaveCopy();
        MailItem objm = new MailItem();

        EmailMessage email = new EmailMessage(service);
        email.ToRecipients.Add("abc@xyz.com");
        email.Subject = "Test Message";
        email.Body = new MessageBody("Message message sent via EWS Managed API");
        email.SetExtendedProperty(extendedPropertyDefinition, OlPermission.olDoNotForward);

        //email.ConversationTopic = (AllowedResponseActions)OlPermission.olDoNotForward;
        email.Send();
我搜索过谷歌,但没有找到任何与上述查询相关的内容

任何帮助都将不胜感激

OUTLOOK对象 我使用MailItem对象执行此操作,并且发件人id为outlook客户端电子邮件,这不正确。我需要对其他地址执行此操作

Outlook.Application oApp=新建Outlook.Application(); //创建一个新的邮件项目。 Outlook.MailItem oMsg=(Outlook.MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem); oMsg.HTMLBody=“Hi”; //主题行 oMsg.Subject=“Outlook客户端测试电子邮件”; oMsg.Recipients.Add(“xyz@abc.com"); oMsg.Permission=OlPermission.olDoNotForward;
oMsg.Send()

这要求您对记录在中的消息设置PidLidVerbStream属性。中有一个示例

干杯
Glen

在outlook权限选项中访问发送电子邮件时要使用的选项,该选项限制用户获取屏幕截图,转发和复制电子邮件内容。如果您谈论RMS,EWS中没有任何内容可以帮助您做到这一点,这相当复杂,因为它涉及到拥有RMS证书和注册RMS服务。我建议您改用Outlook对象Mobel,因为这将允许您使用处理证书注册的Outlook RMS客户端等。请参阅我将如何将Outlook对象分配给EWS或使用其他未启用Outlook的电子邮件地址发送电子邮件,在outlook mailitem对象的帮助下,请共享代码行。您不需要使用outlook OOM作为API来执行邮件加密。EWS无法处理底层加密。我的要求是通过EWS或SMTP发送outlook中具有“请勿转发”权限的电子邮件。那么,你能告诉我实现同样目标的方法吗?如果不能,为什么。