Click to See Complete Forum and Search --> : How to read mail from Outlook Express InBox folder


Sajid
March 31st, 1999, 12:37 AM
Hi,

Can some one guide me how can i read mail from Outlook Express Inbox folder.

I had experience of getting mail using POP3 and MAPI.

Is it different for Outlook and Netscape Mail Client.

Thanks.

Sajid.

AimSoft
March 31st, 1999, 09:17 AM
Hi,


I have been searching the InterNet to get info about that.

I found many samples for VB, I wanted some for VC++.


What I found out is that it is possible through OutLook automation.


Here is one of the VB Samples that I found :


The FillFolderCombo and FillMailboxCombo subroutines are very similar. They work by opening a connection to Outlook and populating the combos with the names of folders. When a user has access to other Mailboxes, they are treated as top level folders within Outlook. FillFolderCombo accesses the subfolders of the specified Mailbox and populates the Folder combo with them.


Private Sub FillFolderCombo()

On Error GoTo Err_Folder

' 'Put the names of all available folders in the folderCombo



Dim myOlApp As Object

Dim olNamespace As Object

Dim iCount As Integer

Dim mystr As String




Set myOlApp = CreateObject("Outlook.Application")

Set olNamespace = myOlApp.GetNameSpace("MAPI")



iCount = 1

FolderCombo.Clear

mystr = MailboxCombo



While iCount <= olNamespace.folders(mystr).folders.Count

FolderCombo.AddItem olNamespace.folders(mystr).folders(iCount).Name

iCount = iCount + 1

Wend



Exit Sub

Err_Folder:

MsgBox "Unable to resolve mailbox"

End Sub



Private Sub FillMailboxCombo()

'--Fill in all the names of available mailboxes



Dim myOlApp As Object

Dim olNamespace As Object

Dim iCount As Integer



Set myOlApp = CreateObject("Outlook.Application")

Set olNamespace = myOlApp.GetNameSpace("MAPI")



iCount = 1

MailboxCombo.Clear

While iCount <= olNamespace.folders.Count

MailboxCombo.AddItem olNamespace.folders(iCount).Name

iCount = iCount + 1

Wend

End Sub


Please let me know if you got any information about that.


Abdulrahman