Using MAPI to read email
I am trying to use Microsoft MAPI to read email from an exchange server with vb.net. Does anyone have an example of how to do this in any .NET language?
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim session As New MSMAPI.MAPISession
Dim m As New MSMAPI.MAPIMessages
session = CreateObject("MAPI.Session", "exchange.mailserver.com")
session.UserName = "developertest"
session.Password = "developer"
Try
session.SignOn()
Catch ex As Exception
MessageBox.Show("not signed it")
End Try
MessageBox.Show("Done")
session.SignOff()
This is the code I have just fumbled through so far. But when I try to run it, it fails at session = CreateObject("MAPI.Session", "exchange.mailserver.com") with a message like cannot create active x component. Ideas, please?

