我正在使用 winRT C++ 开发一个 Windows 商店应用程序。我可以通过电子邮件共享文件,但它不能指定接收者的电子邮件地址。贝娄是我共享文件的代码的一部分:-
DataRequest^ request = e->Request;
request->Data->Properties->Title = "Testing";
request->Data->Properties->Description = "Email With Attachment";
DataRequestDeferral^ deferral = request->GetDeferral();
create_task(Windows::ApplicationModel::Package::Current->InstalledLocation->GetFileAsync("testing.pdf")).then([this, request, deferral](task<StorageFile^> getFileTask)
{
try
{
auto pdfFile = getFileTask.get();
auto storageItems = ref new Platform::Collections::Vector<IStorageItem^>();
storageItems->Append(pdfFile);
request->Data->SetStorageItems(storageItems);
deferral->Complete();
}
catch (Exception^ ex)
{
// Calling FailWithDisplayText() also calls Complete on the deferral.
request->FailWithDisplayText(ex->Message);
}
});
如何在不手动填写电子邮件地址的情况下将附件文件发送到特定的电子邮件收件人。