使用以下代码从通用应用程序发送附件不起作用,为什么?
Dim emailMessage As New EmailMessage()
emailMessage.[To].Add(New EmailRecipient("a@b.com"))
emailMessage.Subject = "Test"
emailMessage.Body = "Hello World"
Dim localAppFolder = Windows.Storage.ApplicationData.Current.LocalFolder
Dim file = Await localAppFolder.CreateFileAsync("SomeFile.txt", Windows.Storage.CreationCollisionOption.ReplaceExisting)
Await Windows.Storage.FileIO.WriteTextAsync(file, "aaaa")
Dim fileRef = RandomAccessStreamReference.CreateFromFile(file)
emailMessage.Attachments.Add(New EmailAttachment(file.Name, fileRef))
Await EmailManager.ShowComposeNewEmailAsync(emailMessage)
Run Code Online (Sandbox Code Playgroud)
To,subject和body在Outlook中显示正常,但附件丢失:Outlook截图