Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

BUG: Cannot Use CDO SendUsingExchange Method Across Domains


View products that this article applies to.

This article was previously published under Q260798

↑ Back to the top


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.

↑ Back to the top


Cause

The MailboxUrl property is not set.

↑ Back to the top


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
				

↑ Back to the top


Status

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

↑ Back to the top


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
				

↑ Back to the top


Keywords: KB260798, kbprb, kbmsg, kbbug

↑ Back to the top

Article Info
Article ID : 260798
Revision : 5
Created on : 2/22/2007
Published on : 2/22/2007
Exists online : False
Views : 319