[英]How Fetch Emails From A Specific Email Address On My Mail Server With C#
[英]How to Share File to specific email address
我正在使用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);
}
});
如何将附件文件发送到特定的电子邮件收件人,而无需手动填写电子邮件地址。
在Windows 8中无法做到这一点。 您可以共享文件(如上面的代码中所述),也可以将电子邮件发送到显式地址(使用LaunchUriAsync
和mailto:
URI),但是您不能两者都做。
请注意,“共享目标”应用程序可能会要求系统记住最近/经常使用的目标 ,因此,如果用户最近通过电子邮件发送了bob@foo.com,则它可能会作为“共享选择器”中的直接选项出现。 内置邮件应用程序使用此功能。
另一个低保真的选择是将电子邮件地址复制到剪贴板,并要求用户在启动电子邮件应用程序时简单地将其粘贴(或将文件复制到剪贴板并使用mailto:
方法)。
听起来您要做的就是与特定收件人一起创建新的电子邮件。 最简单的方法是使用EmailManager.ShowComposeNewEmailAsync API。 如果您的用户希望使用Facebook或Twitter发送内容,我还建议保留共享作为一种选择。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.