Article ID: 195381
Article Last Modified on 7/13/2004
Dim oSession As MAPI.Session
Dim oOutbox As Folder
Dim omessage As Message
Dim oRecip As Recipient
' Create the session and log on.
Set oSession = CreateObject("mapi.session")
oSession.Logon
' Get the outbox and add the message.
Set oOutbox = oSession.Outbox
Set omessage = oOutbox.Messages.Add
' Set the properties on message.
Set oRecip = omessage.Recipients.Add
oRecip.Name = "conference room"
oRecip.Resolve
omessage.Subject = "Test message with send options set"
omessage.Text = "This is the body."
' Setting the delivery time and the Expiry settings for the message.
' The property setting times are in a 24 hour format.
' Message sending options:
' CdoPR_DEFERRED_DELIVERY_TIME = &HF0040
' CdoPR_EXPIRY_TIME = &H150040
' This message will be delivered at 10:00 AM on October 23, 1998
omessage.Fields.Item(CdoPR_DEFERRED_DELIVERY_TIME) = _
"1998/10/23 10:00:00"
' This message will expire at 6:00 PM on October 23, 1998
omessage.Fields.Item(CdoPR_EXPIRY_TIME) = "1998/10/23 18:00:00"
' Update the message and send it.
omessage.Update
omessage.Send
' Logoff and cleanup
oSession.Logoff
Set oSession = Nothing
Additional query words: delivery time expiration
Keywords: kbhowto kbmsg KB195381