BUG: Cannot Use CDO SendUsingExchange Method Across Domains (260798)



The information in this article applies to:

  • Microsoft Exchange 2000 Server

This article was previously published under Q260798

SYMPTOMS

When sending an e-mail message by way of Collaboration Data Objects (CDO) for Exchange 2000 using the SendUsingExchange enumeration between two domains, you may receive the following error:
-2147220941: Could not find the Sender's mailbox.

CAUSE

The MailboxUrl property is not set.

RESOLUTION

When sending e-mail using the SendUsingExchange enumeration, you may need to set the MailboxURL property; the following code demonstrates how to do this:
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"
    'ToDo: Change to a valid MailboxURL. This is the sender's mailbox URL.
    oConfig.Fields(cdo.cdoMailboxURL) = "file://./BackOfficeStorage/domain/MBX/user1"
    oConfig.Fields.Update
End Function
				

STATUS

Microsoft has confirmed that this is a problem in Microsoft Exchange 2000 Server.

MORE INFORMATION

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
				

Modification Type:MinorLast Reviewed:3/4/2004
Keywords:kbbug kbMsg kbprb KB260798