472,794 Members | 3,064 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,794 software developers and data experts.

Using IMAP To Access Calendar on Exchange Server

Hi,

I am fairly new to .NET (coming from a Java background) and I am trying to
port an application that I originally wrote in Java, to .NET / C#. My problem
is that I cannot find a C# analog for the javax.mail library. My original
program used this to access the calendar on Exchange, via IMAP and retrieve
appointments.

I have no idea how to do this. Any help, advice, or even general guidelines
would be much appreciated. I would be very surprised if what I wanted to do
wasn't possible.

Here's a snippet of the original Java code. As you can see, it should be
fairly easy to do:

public void checkCal() {

Folder folder = null;
Store store = null;
// 1. Open the mailbox and retrieve messages
System.out.println("user: " + user + "Password: " + passwd);
URLName url = new URLName(protocol, imapHost, -1, mbox, user, passwd);
Session session = Session.getDefaultInstance(props, null);
session.setDebug(false);
store = session.getStore(url);
store.connect(); //this is a resource that needs to be cleaned up!
folder = store.getDefaultFolder();
folder = folder.getFolder(mbox);
folder.open(Folder.READ_WRITE);
int totalMessages = folder.getMessageCount();

System.out.println("Num Messages=" + totalMessages);
Message[] msgs = folder.getMessages();
FetchProfile fp = new FetchProfile();
fp.add(FetchProfile.Item.ENVELOPE);
folder.fetch(msgs, fp);
}
Jul 21 '05 #1
2 8315
Oops.... what I meant to say was that I couldn't find a .NET analog for
javax.mail.... I am writing the program in C#

"nh_capricorn" wrote:
Hi,

I am fairly new to .NET (coming from a Java background) and I am trying to
port an application that I originally wrote in Java, to .NET / C#. My problem
is that I cannot find a C# analog for the javax.mail library. My original
program used this to access the calendar on Exchange, via IMAP and retrieve
appointments.

I have no idea how to do this. Any help, advice, or even general guidelines
would be much appreciated. I would be very surprised if what I wanted to do
wasn't possible.

Here's a snippet of the original Java code. As you can see, it should be
fairly easy to do:

public void checkCal() {

Folder folder = null;
Store store = null;
// 1. Open the mailbox and retrieve messages
System.out.println("user: " + user + "Password: " + passwd);
URLName url = new URLName(protocol, imapHost, -1, mbox, user, passwd);
Session session = Session.getDefaultInstance(props, null);
session.setDebug(false);
store = session.getStore(url);
store.connect(); //this is a resource that needs to be cleaned up!
folder = store.getDefaultFolder();
folder = folder.getFolder(mbox);
folder.open(Folder.READ_WRITE);
int totalMessages = folder.getMessageCount();

System.out.println("Num Messages=" + totalMessages);
Message[] msgs = folder.getMessages();
FetchProfile fp = new FetchProfile();
fp.add(FetchProfile.Item.ENVELOPE);
folder.fetch(msgs, fp);
}

Jul 21 '05 #2
nh_capricorn wrote:
port an application that I originally wrote in Java, to .NET / C#. My problem
is that I cannot find a C# analog for the javax.mail library.


Wow, the Java code looks quite elegant! I'd be interested to see side by
side compare with .NET

Exchange traditionally used MAPI, and if you do a search on "CDO" you'll
find a lot of information about the object model and what you can do
with it - including managing calendars, but I'm not sure about IMAP.
You're talking "open-standards" here, which don't always sit too well in
the Microsoft world!

One thing I did notice that's funny - the latest Exchange SDK states
that it's "not compatible with .NET" and guess what... you have to use
COM interop! I guess .NET doesn't "rock" quite as hard as we were lead
to believe in the latest press release.

--
Gerry Hickman (London UK)
Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Chuck Anderson | last post by:
Can anyone point me in the right direction? I want to use Php to automate confirmation of someone joining an email list by them replying to an email (so they don't have to have a browser?). I...
5
by: Mike | last post by:
I need to provide an example to upper management on how this works, but I don't have the time to write one. Does someone already have some code (java and c/vc/vc++) that demonstrates java using...
1
by: Kjell Wilhelmsen | last post by:
Hi ... I'm working on a program that's importing/exporting data between our Intranet and our ActiveDirectory and Exchange server. Does anybody out there know how to create a meeting in a users...
5
by: kapila Wijethilaka | last post by:
Can anybody give me details ,codes and urls for developing a web based(Asp.net c#) mail client who uses IMAP4 protocoll to retrieve mails from Exchange server. thanks -Kapila
3
by: Curt_C [MVP] | last post by:
Hey all, I can't seem to find a good link to reading an Exchange (2000) calendar with ASP.NET 1.1 Anyone got a good pointer/starter/link? Thanks -- Curt Christianson site:...
2
by: nh_capricorn | last post by:
Hi, I am fairly new to .NET (coming from a Java background) and I am trying to port an application that I originally wrote in Java, to .NET / C#. My problem is that I cannot find a C# analog for...
14
by: sridhar | last post by:
iam having user account on an exchangeserver. with that can i send an email using python? if iam using the following code iam getting error fromAddress = 'sridhar_kasturi@satyam.com'...
4
by: gregpinero | last post by:
I'm trying to get a list of messages from GMAIL using it's new IMAP access. So far I've tried running this command but it just hangs. Any ideas? I figured that's the first line to run from...
3
by: samvb | last post by:
Hello Gusy, I want to access a local mail server using imap from php. But i was not able to connect at all. I have read many codes but none of them worked for me. Do I need any special "imap" or...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.