Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 305019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:20:04+00:00 2026-05-12T07:20:04+00:00

I am using webDAV and .Net 2.0 to gather information on an email account

  • 0

I am using webDAV and .Net 2.0 to gather information on an email account on a server running Exchange Server 2003. I have access to the uri which looks like this:

http://my.mailserver.com/exchange/user/Inbox/someImportantEmail.EML

I attempted to copy the file like so:

Dim uri As New Uri(uriNode.InnerText)
If uri.IsFile() Then
    Dim fn As String = Path.GetFileName(uri.LocalPath)
    System.IO.File.Copy(uri.LocalPath, "c:\" & fn)
End If

But uri.IsFile() is always returning false. One other thing I noted is that uri.Local path is

/exchange/user/Inbox/someImportantEmail.EML

I this part of my problem? How can I copy the .eml file from the exchange server to the local hard drive?

EDIT:
I have implemented AnthonyWJones suggestion

    Dim cred As New System.Net.CredentialCache
    cred.Add(uri, "BASIC", New System.Net.NetworkCredential(_username, _password, _domain))
    Dim wc As New WebClient()
    wc.Credentials = cred
    wc.DownloadFile(uri, "c:\testEML.EML")

and while this does create the testEML.EML file on my c drive… here are the contents of the EML file:

<!--Copyright (c) 2000-2003 Microsoft Corporation. All rights reserved.-->
<!--CURRENT FILE== "NON-IE5" "NON-WIN32" frameset -->
<!--CURRENT TEMPLATE == frameset.00000000 -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=utf-8">
<TITLE>Microsoft Outlook Web Access</TITLE>
<BASE href="http://my.mailserver.com/exchange/user/">
</HEAD>
<SCRIPT language="JavaScript">
var g_iNewWindowWidth = 700;
var g_iNewWindowHeight = 500;
var g_fWarnOnLogOff=false;
function WarnOnLogOff()
{
if (g_fWarnOnLogOff)
alert("To help protect your mailbox from unauthorized access, close all browser windows when you finish using Outlook Web Access.");
}
</SCRIPT>
<FRAMESET OnUnload="WarnOnLogOff()" framespacing="3" cols="190,*"><FRAME bordercolor="#3D5FA3" name="navbar" title="Navigation" src="Inbox/?Cmd=navbar" marginheight="0" marginwidth="0" scrolling="auto" border="1"><FRAME name="viewer" title="Contents" src="Inbox/FW:.EML?Cmd=open" scrolling="auto">
<NOFRAMES>
<BODY><P>This page uses frames, but your browser doesn't support them.</P></BODY>
</NOFRAMES>
</FRAMESET>
</HTML>

What’s with the unauthorized access??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T07:20:04+00:00Added an answer on May 12, 2026 at 7:20 am

    This is the code I ended up with that did exactly what I needed.

        Dim msgPath As String = message.Path
        Dim msgURI As String = message.URI
        Dim msgID As String = message.ID
    
        MyCredentialCache = New System.Net.CredentialCache()
        MyCredentialCache.Add(New System.Uri(_inboxPath), "BASIC", New System.Net.NetworkCredential(_username, _password, _domain))
    
        Dim request As WebRequest = WebRequest.Create(msgURI)
        request.Credentials = MyCredentialCache
        request.ContentType = "text/xml"
        request.Headers.Add("Translate", "f")
        Dim response As HttpWebResponse = CType(request.GetResponse(), HttpWebResponse)
    
        Dim file As FileStream = New FileStream(msgPath, FileMode.CreateNew)
        Dim stream As Stream = response.GetResponseStream()
    
        Dim buffer() As Byte = New Byte(4096) {}
        Dim len As Integer = stream.Read(buffer, 0, buffer.Length)
    
        While (len > 0)
            file.Write(buffer, 0, len)
            len = stream.Read(buffer, 0, buffer.Length)
        End While
    
        file.Close()
        stream.Close()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am running a subversion server with access via http using webdav. I have
I've been trying to retrive attachment from message in Exchange 2003 server using WebDAV.
I have started writing my own WebDAV server class in .NET, and the first
I am trying to access the Exchange 2007 mail store programmatically using WebDAV. However,
I have an Exchange Server running in a remote machine. We also have an
I have been using WebDAV in PHP directly using XML. I have managed to
I have set up WebDAv server on my Debian linux and this is working
I have deployed the WebDav server on Debian Linux and give appropriate permission. While
I want to give users access to WebDav using Apache, but I want to
I have an asp.net page which calls a webservice. I wanted to check the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.