Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Reading Email Programmatically
Hello folks. I am trying to write a program that will connect to a microsoft exchange server and read the email. I have heard that Microsoft MAPI is the way to go. I just have not figured out how to make it work. I have found lots of examples of how to send mail, but I have not been able to receive mail. Does anyone have a code sample I could check out? Is there a book someone can recommend? I have tried the following code and when I get to the CreateObject line I get an error like "Cannot create ActiveX control." Does anyone have suggestions? Is there a step I missed in the IDE?
Public Class Form1
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"
Catch ex As Exception
MessageBox.Show("not signed it")