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