Results 1 to 1 of 1

Thread: Connecting to an MS Exchange Server from VB .NET Console application

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2002
    Location
    India
    Posts
    19

    Connecting to an MS Exchange Server from VB .NET Console application

    Hello,

    I have a console application written in VB .NET which connects to an Exchange Server and accesses the messages in the Public Folders. I am using Collaborative Data Objects to do this. When I run the service it works fine but when My Public accessing folder is Empty (no New messages), I get the following error...

    System.NullReferenceException: Object reference not set to an instance of an object.

    My logon method looks like this ...

    oSession = New MAPI.Session

    '** Logon to the Exchange Server **'
    Try
    oSession.Logon(, , , , , , server & vbLf & user)
    Catch e As System.Runtime.InteropServices.COMException
    EventLog1.WriteEntry(e.ToString())
    End Try

    Here "server" is the name of the Exchange Server and "user" is name of the mailbox account on the exchange server. This piece of code works perfectly on one exchange server (Exchange server 2003)and does what it is supposed to do but when it is run on another exchange server(Exchange server2000), it throws the above error.

    is there any problem in coding ?

    Please help Me
    Thanks in advance
    Last edited by ddp2307; Dec 11th, 2003 at 05:40 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width