ISMTPTransport::SendMessage method

[ISMTPTransport::SendMessage is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions.]

Sends a Simple Mail Transport Protocol (SMTP) message.

Syntax

HRESULT SendMessage(
  [in] LPSMTPMESSAGE pMessage
);

Parameters

pMessage [in]

Type: LPSMTPMESSAGE

Specifies a pointer to the SMTPMESSAGE structure that contains the message to send.

Return value

Type: HRESULT

Returns one of the following values.

Return code Description
S_OK
Indicates success.
E_INVALIDARG
Indicates that pMessage is NULL or that the message stream is NULL.
E_OUTOFMEMORY
Indicates that an attempt to allocate memory failed.
IXP_E_BUSY
Indicates that the transport is busy.
IXP_E_INVALID_ADDRESS_LIST
Indicates that rInetAddrList contains invalid entries.
IXP_E_NOT_CONNECTED
Indicates that Connect has not been called or that the current connection has been lost. The transport does not automatically reconnect.
IXP_S_SMTP_NO_DSN_SUPPORT
Indicates that the server doesn't support DSN.

Remarks

Connect must be called before this method and the transport must be in the ready state. When the message is finished or if an error ocurrs, OnResponse is called.

This method duplicates the contents of pMessage and adds a reference for pMessage->pstmMsg so that the client can free pMessage immediately after calling this method.

Requirements

Minimum supported client
Windows XP [desktop apps only]
Minimum supported server
Windows Server 2003 [desktop apps only]
Product
Outlook Express 6.0
Header
Imnxport.h
IDL
Imnxport.idl
DLL
Inetcomm.dll (version 6.0 or later)