Programmatically Attach PDF from MemoryStream to Outlook E-Mail Items

为君一笑 提交于 2019-12-12 03:37:27

问题


Would it be possible to attach PDF from MemoryStream or other functions to Outlook E-Mail Items MailItem.Attachment.add(), rather than from the file on the hard disk by passing the physical path of file in this method.

I would like to create the Outlook mailitem for the users with the PDF attached programmatically, and let the users to review and send out the email by themselves.

Thank you in advance.


回答1:


Not using the Outlook Object Model - Attachments.Add will only let you pass a file name for the olByValue attachments. Extended MAPI (C++ or Delphi) only operates on IStream objects (IAttach::OpenProperty(PR_ATTACH_DATA_BIN, IID_IStream,...)), Redemption lets you pass file name, url, array, IStream or IStorage to RDIOAttachments.Add.



来源:https://stackoverflow.com/questions/39071261/programmatically-attach-pdf-from-memorystream-to-outlook-e-mail-items

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!