UI2.ShowMailItem Method (String, String, String, String, String)

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

Namespace:  Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly:  Microsoft.Office.Interop.InfoPath.SemiTrust (in Microsoft.Office.Interop.InfoPath.SemiTrust.dll)

Syntax

'Declaration
Sub ShowMailItem ( _
    bstrTo As String, _
    bstrCC As String, _
    bstrBCC As String, _
    bstrSubject As String, _
    bstrBody As String _
)
'Usage
Dim instance As UI2
Dim bstrTo As String
Dim bstrCC As String
Dim bstrBCC As String
Dim bstrSubject As String
Dim bstrBody As String

instance.ShowMailItem(bstrTo, bstrCC, _
    bstrBCC, bstrSubject, bstrBody)
void ShowMailItem(
    string bstrTo,
    string bstrCC,
    string bstrBCC,
    string bstrSubject,
    string bstrBody
)

Parameters

  • bstrTo
    Type: System.String

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

  • bstrCC
    Type: System.String

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

  • bstrBCC
    Type: System.String

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

  • bstrSubject
    Type: System.String

    The subject of the e-mail message.

  • bstrBody
    Type: System.String

    The body text of the e-mail message.

Implements

UI.ShowMailItem(String, String, String, String, String)

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 MailEnvelopeObject object or EmailAdapterObject object to programmatically create e-mail messages.

Important

This member 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.

Examples

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

thisXDocument.UI.ShowMailItem("someone@example.com", "", "", "Updated Form", "Here is the updated form that you requested.");

See Also

Reference

UI2 Interface

UI2 Members

ShowMailItem Overload

Microsoft.Office.Interop.InfoPath.SemiTrust Namespace