Question

Locked

How to retrieve mails directly from exchange server 2003 using vb.net appl.

By b.praveen999 ·
Hi Friends,

i'm fetching mails with vb.net appl. using outlook object through MAPI function. but, now the requirement is to fetch mails directly from exchange server, without interacting with outlook.Plz, can anyone help me how to do this.
Its urgent. plz..
Thanks,
Praveen.

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Use Redemption

by vojimir.kecman In reply to How to retrieve mails dir ...

Imports Redemption
Private Sub CheckExchangeEmail()
Const olFolderInbox As Redemption.rdoDefaultFolders = 6
Dim Session As New Redemption.RDOSession
Dim objFolder As Redemption.RDOFolder
Dim oItems As Object
Dim oItem As Redemption.RDOMail
Dim sMessageBody As String

Do
Try
Session.LogonExchangeMailbox("username@mycompany.com", "myexchangeserver.com")
objFolder = Session.GetDefaultFolder(olFolderInbox)
oItems = objFolder.Items
For Each oItem In oItems
If (oItem.UnRead) Then
'Do whatever you need this for
sMessageBody = oItem.Body
oItem.MarkRead(True)
End If
Next
Catch ex As Exception
Session = Nothing
Finally
If Not IsNothing(Session) Then
If Session.LoggedOn Then
Session.Logoff()
End If
End If
End Try
Loop
End Sub

Collapse -

Trying to use Redemption

by tmcdevitt In reply to Use Redemption

I am using this code but I am getting error Error in IMAPISession:penMsgStore: RPC_E_CHANGED_MODE

Back to Networks Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums