When you set the value of the http://schemas.microsoft.com/cdo/configuration/savesentitems configuration value or its equivalent named constant, cdoSaveSentItems, to False in Collaboration Data Objects for Exchange 2000 (CDOEX), the configuration is ignored on Microsoft Exchange Server 2003 and on Microsoft Exchange 2000 Server. You expect that if you set this value to False, a user can send an e-mail message through code and not save the e-mail message to the Sent Items folder.
↑ Back to the top
The e-mail message is always saved to the Sent Items folder. The Microsoft Developer Network (MSDN) documentation incorrectly states that you can determine whether an e-mail message is saved to the Sent Items folder when you set this field to False.
↑ Back to the top
This behavior is by design. The MSDN documentation will be updated in a future release.
↑ Back to the top
Steps to reproduce the behavior
Note The following code must run on a computer that is running Exchange Server 2003 or Exchange 2000 Server.
- Start Microsoft Visual Basic 6.0. Then, create a new Standard EXE project.
- Add a reference to the Microsoft CDO for Exchange 2000 Library.
- Add a CommandButton control to the form.
- Double-click the button, and then replace the default code with the following code.
Private Sub Command1_Click()
Dim oMsg As CDO.Message
Set oMsg = New CDO.Message
'Exchange
oMsg.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 3
oMsg.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/savesentitems") = False
oMsg.Configuration.Fields.Update
'Change this address to the test mailbox address.
oMsg.To = "to@test.com"
'Change this to your address.
oMsg.From = "from@test.com"
oMsg.Subject = "savesentitems Test!!"
oMsg.HTMLBody = "Look in the sent items folder!!!!"
oMsg.Send
Set oMsg = Nothing
End Sub
- Change the "To" address and the "From" address in the code.
- Run the code.
- Click the button on the form.
- Verify that the new test e-mail message appears in the mailbox. Then, verify that the e-mail message appears in the Sent Items folder.
↑ Back to the top