Steps to Reproduce Behavior
This error can occur when your environment is configured in the following manner. Users are created in Domain1 and Domain2. All users have an Exchange 2000 mailbox, and the Exchange Server is in Domain2. Users can access their local mailboxes, as well as send e-mail, by way of CDO for Exchange 2000 using
SendUsingPort and
SendUsingPickup.
Modify the code below so that cdo.cdoSendEmailAddress is an address of a user in Domain1. Run the code on the Exchange Server, and the error should be returned.
Sub Main
Dim oMessage As New cdo.Message
SetConfig oMessage.Configuration, cdoSendUsingExchange
oMessage.Subject = "Test Subject via Exchange"
'ToDo: Change Recipient to a valid e-mail address.
oMessage.To = "user@yourdomain.com"
oMessage.TextBody = "Testing"
oMessage.Send
Debug.Print Err.Number & ": " & Err.Description
Set oMessage = Nothing
End Sub
Function SetConfig(ByRef oConfig As cdo.Configuration, eSendUsingMethod As cdo.CdoSendUsing)
Dim iCount As Integer
For iCount = 1 To oConfig.Fields.Count
oConfig.Fields.Delete 0
oConfig.Fields.Update
Next
oConfig.Fields(cdo.cdoSendUsingMethod) = eSendUsingMethod
'ToDo: Change to a valid servername.
oConfig.Fields(cdo.cdoSMTPServer) = "ServerName"
oConfig.Fields(cdo.cdoSMTPServerPort) = 25
'ToDo: Change to a valid e-mail address. This is the sender's address oConfig.
Fields(cdo.cdoSendEmailAddress) = "user1@otherdomain.com"
oConfig.Fields.Update
End Function