您應該可以使用EmailMessage class。樣本代碼可以是這樣的:
private async void SendBtn_Click(object sender, RoutedEventArgs e)
{
EmailMessage email = new EmailMessage { Subject = "Sending test file" };
email.To.Add(new EmailRecipient("[email protected]"));
// Create a sample file to send
StorageFile file = await ApplicationData.Current.LocalFolder.CreateFileAsync("testFile.txt", Windows.Storage.CreationCollisionOption.ReplaceExisting);
await FileIO.WriteTextAsync(file, "Something inside a file");
email.Attachments.Add(new EmailAttachment(file.Name, file)); // add attachment
await EmailManager.ShowComposeNewEmailAsync(email); // send email
}
我用DataTransferManager準備的內容,然後讓用戶選擇一個電子郵件應用程序,我成功設置郵件的標題:'request.Data.Properties.Title = loger.GetFileName();'但不是目的地。任何幫助? – tufekoi