Send Method
Topic Last Modified: 2006-12-01
The Send method sends the message.
Applies To
Type Library
Microsoft CDO for Exchange 2000 Library
DLL Implemented In
CDOEX.DLL
Syntax
Sub Send()
HRESULT Send
();
Return Value
Returns S_OK if successful, or an error value otherwise.
Remarks
How the message is sent depends upon 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, whether 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 it and release the memory, you should release all outstanding references to the implementing object in the standard way.
Example
Dim iMsg As New CDO.Message
Dim iConf As 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@example.com"
.Subject = "A short message"
.TextBody = "Text of this short message."
.Send
End With
See Also
Other Resources
Configuration Property
sendusing Field
sendusername Field
sendpassword Field