Hi Goyal,

In the mailbox url you'll have to add the mailbox name. 
Thus the url will be:
https://webmail.company.com/exchange/usermailbox

Hope this helps
Edward


----- Original Message -----
From: Goyal, Bharat (GMI Development) <[EMAIL PROTECTED]>
To: Devos, Edward
Sent: Thu May 17 21:32:45 2007
Subject: RE: Using slide/webdav to fetch email

Hi Edward,
Thanks for your message. I did download the binaries. Here is what I am
wanting to do:

I just want to write a simple java program that can connect to an
Outlook inbox (I have the username and password) on an Exchange server
(it can be accessed via https) and get any new messages and mark the
messages that it reads.

I believe your program is more of a mail forwarder. I tried to see your
source code and just use the part till where it reads the messages. Here
is what I tried to do.

What I am gettng is this:

---Inbox reply:
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
</HEAD>
<body><h2>HTTP/1.1 404 Resource Not Found</h2></body></HTML>
---Inbox reply end

Am I missing something here.
Your help is appreciated.
Bharat

        String prootPath = "https://webmail.company.com/exchange/";;
                PropFindMethod propfind = new PropFindMethod(prootPath);
                HttpClient client = new HttpClient();
                String fromSrv = "webmail.company.com";
                
                NTCredentials creds = new NTCredentials("foo", "bar",
                                "webmail.company.com", "BGD");
                
                client.getState().setCredentials(
                                new AuthScope(fromSrv, 443), creds);
                                
                int status = 0;
                try {
                        propfind.setRequestEntity(new
StringRequestEntity(getInboxMsg(), null,        null));
                        status = client.executeMethod(propfind);
                } catch (HttpException httpe) {
                        System.err.println("HttpException in
fetchAll()):"+httpe.getMessage());
                } catch (IOException ioe) {
                        System.err.println("IO error in
fetchAll():"+ioe.getMessage());
                }
                
                System.out.println("---Inbox reply:");
                try {
        
System.out.println(propfind.getResponseBodyAsString());
                } catch (IOException ioe) {
                        System.err.println("IO error in
fetchAll():"+ioe.getMessage());
                }
                System.out.println("---Inbox reply end");
                
                        
        }
        
        private static String getInboxMsg() {
                StringBuffer strBuf = new StringBuffer(200);
                strBuf.append("<?xml version=\"1.0\" encoding=\"utf-8\"
?><D:propfind xmlns:D=\"DAV:\" xmlns:a=\"urn:schemas:httpmail:\">\r\n");
                strBuf.append("<D:prop>\r\n");
                strBuf.append("<a:inbox/>\r\n");
                strBuf.append("</D:prop>\r\n");
                strBuf.append("</D:propfind>\r\n");
                return strBuf.toString();
        }

-----Original Message-----
From: Devos, Edward [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 17, 2007 2:42 PM
To: slide-user@jakarta.apache.org
Subject: Re: Using slide/webdav to fetch email


Hi Goyal,

Checkout : http://personal.inet.fi/atk/fetchexc

This is javacode, that does just that.

Hope it helps
Edward


----- Original Message -----
From: Goyal, Bharat (GMI Development) <[EMAIL PROTECTED]>
To: slide-user@jakarta.apache.org <slide-user@jakarta.apache.org>
Sent: Thu May 17 20:35:48 2007
Subject: Using slide/webdav to fetch email

Hi,
I am new to WebDAV. I am wanting to fetch my email from my Inbox on an
Exchange Server that allows HTTPS access in my application. Can someone
please send me some code snippet that may be helpful.

Thanks,
Bharat
--------------------------------------------------------

 If you are not an intended recipient of this e-mail, please notify the
sender, delete it and do not read, act upon, print, disclose, copy,
retain or redistribute it. Click here for important additional terms
relating to this e-mail. http://www.ml.com/email_terms/

--------------------------------------------------------

Reply via email to