如何发送带有内联附件的电子邮件电子邮件,用于请求的Exchange Server版本Exchange2007_SP1

时间:2017-10-29 08:35:12

标签: c# .net exchangewebservices ews-managed-api

因为不支持Attachment.IsInline属性交换服务器版本Exchange2007_SP1,有没有办法发送内联附件?

string file = @"C:\Temp\Party.jpg";
    message.Attachments.AddFileAttachment("Party.jpg", file);
    message.Attachments[0].IsInline = true;
    message.Attachments[0].ContentId = "Party.jpg";

1 个答案:

答案 0 :(得分:0)

当您创建交换服务对象时,请选择任何高于Exchange2007_sp1的版本:

ExchangeService exchange = new ExchangeService(ExchangeVersion.Exchange2010); // Exchange2010_sp1, Exchange2013 etc.

如果使用Exchange2007_sp1

创建,则不支持以下对象的内联附件
ExchangeService objInlineNotSupportedExchange= new ExchangeService(ExchangeVersion.Exchange2007_SP1);