我使用 Windows.ApplicationModel.Email.EmailMessage 创建了一封电子邮件,并使用以下代码向其添加了一个附件:
var stream = RandomAccessStreamReference.CreateFromFile(file);
var attachment = new EmailAttachment(file.Name, stream);
emailMessage.Attachments.Add(attachment);
await EmailManager.ShowComposeNewEmailAsync(emailMessage);
在 Windows 10 上的默认邮件客户端中,附件显示为附件。但是,附件根本不会出现在具有相同代码的 Outlook 2016 中。有什么解决方法的建议吗?
编辑:显然这是 Windows 10 和所有电子邮件客户端的问题,根据 this 标准 Windows 10 邮件客户端除外。 .
最佳答案
与此同时 docs也提到了它:
Attachments that you add to an email by using the EmailAttachment class will appear only in the Mail app. If users have any other mail program configured as their default mail program, the compose window will appear without the attachment. This is a known issue.
到今天似乎什么都没有改变。
关于c# - 附件未出现在 Outlook 2016 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35629586/