Share via


UI.ShowMailItem Method

InfoPath Developer Reference

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

Version Information
 Version Added:  InfoPath 2003

Syntax

expression.ShowMailItem(bstrTo, bstrCC, bstrBCC, bstrSubject, bstrBody)

expression   An expression that returns a UI object.

Parameters

Name Required/Optional Data Type Description
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.

Return Value
Nothing

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.

Bb229820.vs_note(en-us,office.12).gif  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.

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.

Example

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

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

See Also