• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1005
  • Last Modified:

Enumerate Exchange Emails in vb.Net

I have Exchange Server 2007 on my AD which handles all internal messaging. I want to be able to connect to a specific mailbox with a vb.Net app and enumerate all of the messages in the mailbox. It would be nice to be able to read the html in the message, the headers, and any attachments as well. Thanks.
0
rbichon
Asked:
rbichon
  • 4
1 Solution
 
bramsquadCommented:
I'm not 100% sure but I think there are laws prohibiting that functionality
0
 
rbichonAuthor Commented:
I don't know what you mean by "laws". What I want to do would still require authentication. It would basically act as an email client but would allow me to search for specific headers for advanced processing. I am not trying to hack into my own server.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
rbichonAuthor Commented:
I have looked through it and was only able to get the vbscript example to work that displays the size of the folders in a users mailbox. It seems that most of the other examples use ADO or CDO and I haven't found any help there. Any suggestions?
0
 
rbichonAuthor Commented:
I got most of it working through WebDEV. The only problem I am having is that I cannot get it to download my attachments. Here is the code I am using:

        Dim HttpWebRequest As MSXML2.XMLHTTP60
        Dim GetData As String
        HttpWebRequest = New MSXML2.XMLHTTP60
        With HttpWebRequest
            .open("GET", "https://myserver.com/exchange/username/inbox/test.eml/attachment.pdf", False, UserName, PWD)
            .send()
        End With
        GetData = HttpWebRequest.responseText
        MsgBox(GetData)

This should give me the raw data of the file. Does anyone know a better way of doing this?
0
 
rbichonAuthor Commented:
Finally got it. The code is too long and proprietary to post but I got most of it done with System.Xml.XmlDataDocument and GetElementsByTagName. Downloading attachments has to be done with System.Net.HttpWebRequest.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now