|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
MailEnvelopeObject Interface (Microsoft.Office.Interop.InfoPath.SemiTrust)
Assembly: Microsoft.Office.Interop.InfoPath.SemiTrust (in microsoft.office.interop.infopath.semitrust.dll)
This type is a wrapper for a coclass that is required by managed code for COM interoperability. Use this type to access the members of the COM interface implemented by this coclass. For information about the COM interface, including a link to descriptions of its members, see MailEnvelope.
Using the members of the MailEnvelope interface provides compatibility with InfoPath 2003. To use new members that were added to the MailEnvelope2 object model in Microsoft Office InfoPath 2007, you must cast the object returned by the MailEnvelope property of the WindowObject to the MailEnvelope2 type. For more information, see How to: Use Object Model Members That Are Not Compatible with InfoPath 2003.
The MailEnvelope object provides a number of properties that can be used to programmatically create a custom e-mail message within the default e-mail editor, and it attaches the currently open InfoPath form to the message.
After the e-mail message is created, the default e-mail editor will display the e-mail message; users can then inspect and edit the e-mail message before sending it.
The MailEnvelope object cannot be used to send the e-mail messages it creates; users must manually send the e-mail messages.
You can also use the ShowMailItem method to programmatically create e-mail messages; users must manually send the e-mail messages.
You can also use the ShowMailItem method of the UIObject object to programmatically create e-mail messages.