Platform SDK: CDO for Windows 2000

Send Method

The Send method sends the message.

[Visual Basic]
Sub Send()
[C++]
HRESULT Send();
[IDL]
HRESULT Send();

Remarks

How the message is sent depends on the current configuration. The configuration is defined in the associated Configuration object that is referenced by the Configuration property on this interface. Consult a specific Component Object Model (COM) class implementation for a list of configuration settings used when sending messages.

The message must have at least one recipient in the To, CC, or BCC property before it can be successfully sent.

The Send method does not invalidate this message after submitting it. If you want to invalidate the message and release the memory, you should release all outstanding references to the implementing object in the standard way.

Example

' Reference to Microsoft ActiveX Data Objects 2.5 Library
' Reference to Microsoft CDO for Windows 2000 Library
Set iMsg = New CDO.Message
Dim iConf = New CDO.Configuration
Dim Flds as ADODB.Fields
Set Flds = iConf.Fields
Flds(cdoSendUsingMethod) = cdoSendUsingPort
Flds(cdoSMTPServer)      = "server"
Flds.Update

With iMsg
 Set .Configuration         = iConf
     .MimeFormatted         = False
     .AutoGenerateTextBody  = False
     .To                    = "WhoKnows@microsoft.com"
     .Subject               = "A short message" 
     .TextBody              = "Text of this short message."
     .Send
End With