Share via


SendWorkflowMessage Method

SendWorkflowMessage Method

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Provides a method to send messages that support response tracking, MAPI properties, and transactional e-mail.

Applies To

IWorkflowMessage Interface

Type Library

Microsoft CDO Workflow Objects for Microsoft Exchange

DLL Implemented In

CDOWF.DLL

Syntax

[Visual Basic]Sub SendWorkflowMessage
(
    eSendFlags As CdoWfSendFlags
)

[C++]HRESULT SendWorkflowMessage (     CdoWfSendFlags eSendFlags );

Parameters

  • eSendFlags
    A cdoWfSendFlags constant defining workflow engine tracking behavior for responses to a sent message. For more information, see CdoWfSendFlags Enum.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

You can use both the Send and SendWorkflowMessage methods in workflow, but only SendWorkflowMessage supports response tracking, transactional e-mail, and MAPI properties.

SendWorkflowMessage sets the following in the Configuration object:

  • From = workflow event sink account address.
  • ReplyTo = workflow folder address, unless eSendFlags = cdoWfNoTracking (0). If eSendFlags = cdoWfNoTracking (0), ReplyTo = "" and can be modified by script.
  • cdoSendUsingMethod = cdoSendUsingExchange.

SendWorkflowMessage has the following restrictions:

  • SendWorkflowMessage can only be used with a folder that is mail-enabled. You will get a CDOWF_CANT_OBTAIN_FOLDERADDR error if you try to call it from a folder that is not mail-enabled.
  • SendWorkflowMessage requires that the Workflow Event Sink account have a valid mailbox and that the To field contain a valid address.
  • SendWorkflowMessage cdowfAdd|cdowfStrict cannot be used with an OnCreate event in a script action or condition. You will get a CDOWF_NO_PERM_URL error if you try this in an OnCreate event. SendWorkflowMessage cdowfNoTracking works in an OnCreate event.
  • You can use SendWorkflowMessage in a CompensatingAction, but SendWorkflowMessage behaves differently in a CompensatingAction. In the case of a CompensatingAction, SendWorkflowMessage will send the message immediately, and the message will not be part of a transaction.

Example

The following example uses the WorkflowSession object to get a WorkflowMessage object and sends a message to the user that initiated the state transition with the response tracking turned off.

[Visual Basic]

Dim WfMsg Set WfMsg = WorkflowSession.GetNewWorkflowMessage() With WfMsg .To = WorkflowSession.Sender .Subject = "SendWorkflowMessage Test" .SendWorkflowMessage cdowfNoTracking End With

See Also

CdoWfSendFlags Enum

CDO Workflow for Exchange 2000 Server Error Codes

Event Types

Send us your feedback about the Microsoft Exchange Server 2003 SDK.

Build: June 2007 (2007.618.1)

© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.