How to read inbox of outlook using asp.net
How to read inbox of outlook using asp.net....Please explain with an example
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Roei BarRank #1,271 · 1.4K reputationPosted Aug 25, 2009, 10:19 AM EDT
you can go ahead and try to use it since
the SMTP mail is different from the MAPI mail, I suggest you try
use WebDav to send email via Exchange server which will be integrated with
outlook.
313128 How to send an e-mail message by using WebDAV in Visual C# .NET
http://support.microsoft.com/default.aspx?scid=kb;EN-US;3131 28
290407 How To Use COPY in WebDAV to Copy a Mail Item to Another Folder
http://support.microsoft.com/default.aspx?scid=kb;EN-US;2904 07
290197 How To Use MOVE in WebDAV to Move a Mail Item to Another Folder
http://support.microsoft.com/default.aspx?scid=kb;EN-US;2901 97
hope this helps
asif basha33 reputationPosted Aug 25, 2009, 8:45 PM EDT
using System; using System.Net; using System.IO; namespace WebDavNET { /// /// Summary description for Class1. /// class Class1 { static void Main(string[] args) { try { // TODO: Replace with the name of the computer that is running Exchange 2000. string strServer = "ExchServe"; // TODO: Replace with the sender's alias. string strSenderAlias = "sender"; // TODO: Replace with the sender's e-mail address. string strFrom = "[email protected]"; // TODO: Replace with the recipient's e-mail address. string strTo = "[email protected]"; string strSubject = "Send Using HttpWebRequest"; string strBody = "Hello World"; string sUri; sUri = "http://" + strServer + "/Exchange/" + strSenderAlias; sUri = sUri + "/%23%23DavMailSubmissionURI%23%23/"; System.Uri myUri = new System.Uri(sUri); HttpWebRequest HttpWRequest = (HttpWebRequest)WebRequest.Create(myUri); string sQuery; DateTime mySentTime = new DateTime(); sQuery = "From: " + strFrom + "\n" + "To: " + strTo + "\n" + "Subject: " + strSubject + "\n" + "Date: " + DateTime.Now.ToString() + "\n" + "X-Mailer: My DAV mailer" + "\n" + "MIME-Version: 1.0" + "\n" + "Content-Type: text/plain;" + "\n" + "Charset = \"iso-8859-1\"" + "\n" + "Content-Transfer-Encoding: 7bit" + "\n" + "\n" + strBody; // Set the credentials. // TODO: Replace with the appropriate user credential. NetworkCredential myCred = new NetworkCredential(@"DomainName\User", "Password"); CredentialCache myCredentialCache = new CredentialCache(); myCredentialCache.Add(myUri, "Basic", myCred); HttpWRequest.Credentials = myCredentialCache; // Set the headers. HttpWRequest.Headers.Set("Translate", "f"); HttpWRequest.ContentType = "message/rfc822"; HttpWRequest.ContentLength = sQuery.Length; //Set the request timeout to 5 minutes. HttpWRequest.Timeout = 300000; // Set the request method. HttpWRequest.Method = "PUT"; // Store the data in a byte array. byte[] ByteQuery = System.Text.Encoding.ASCII.GetBytes(sQuery); HttpWRequest.ContentLength = ByteQuery.Length; Stream QueryStream = HttpWRequest.GetRequestStream(); // write the data to be posted to the Request Stream QueryStream.Write(ByteQuery,0,ByteQuery.Length); QueryStream.Close(); // Send the request and get the response. HttpWebResponse HttpWResponse = (HttpWebResponse)HttpWRequest.GetResponse(); // Get the Status code. int iStatCode = (int)HttpWResponse.StatusCode; string sStatus = iStatCode.ToString(); Console.WriteLine("Status Code: {0}", sStatus); // Get the request headers. string sReqHeaders = HttpWRequest.Headers.ToString(); Console.WriteLine(sReqHeaders); // Read the response stream. Stream strm = HttpWResponse.GetResponseStream(); StreamReader sr = new StreamReader(strm); string sText = sr.ReadToEnd(); Console.WriteLine("Response: {0}", sText); // Close the stream. strm.Close(); // Clean up. myCred = null; myCredentialCache = null; HttpWRequest = null; HttpWResponse = null; QueryStream = null; strm = null; sr = null; } catch (Exception e) { Console.WriteLine("{0} Exception caught.", e); } } } } In the above can u help me each and every part under TODO.