ShowMailItem Method

Microsoft Office InfoPath

Creates an e-mail message in the default e-mail editor and attaches the currently open Microsoft Office InfoPath 2003 form to the message.

expression.ShowMailItem(ByVal bstrTo As String, ByVal bstrCC As String, ByVal bstrBCC As String, ByVal bstrSubject As String, ByVal bstrBody As String)

expression    Required. An expression that returns a reference to the UI object.

bstrTo Required String. The e-mail address to send the e-mail message to.

bstrCC Required String. The e-mail address to copy the e-mail message to.

bstrBCC Required String. The e-mail address to blind copy the e-mail message to.

bstrSubject Required String. The subject of the e-mail message.

bstrBody Required String. The body text of the e-mail message.

Security Level

2: Can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.

Remarks

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 ShowMailItem method will return an error if no e-mail editing program is available.

Note  The ShowMailItem method does not send the e-mail messages it creates; users must manually send the e-mail messages.

You can also use the MailEnvelope object, accessed through the MailEnvelope property of the Window object, to programmatically create e-mail messages.

Example

In the following example, the ShowMailItem method of the UI object is used to create a custom e-mail message:

XDocument.UI.ShowMailItem("[email protected]", "", "", 
   "Updated Form", "Here is the updated form that you requested.");