ShowMailItem Method

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.

bstrToRequired String. The e-mail address to send the e-mail message to.

bstrCCRequired String. The e-mail address to copy the e-mail message to.

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

bstrSubjectRequired String. The subject of the e-mail message.

bstrBodyRequired 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("someone@example.com", "", "", 
   "Updated Form", "Here is the updated form that you requested.");

Applies to | UI Object