我试图用附件打开Outlook,如下所示:
Runtime.getRuntime().exec(
new String[] {"rundll32",
"url.dll,FileProtocolHandler",
"mailto:" + "&attachment=" + "c:\\test.txt"}
);
展望开启,但它没有得到附件,我不知道为什么?请指教。
还可以从我的申请中提供附件网址吗?
喜欢:http://myapp.com/files/123(此链接会触发文件下载)
答案 0 :(得分:1)
mailto协议不支持附件。您需要使用Outlook对象模型显式创建Outlook.Application对象的实例,调用Application.CreateItem(),然后使用MailItem.Attachments.Add添加附件。然后,您可以使用MailItem.Display显示消息。