It's not working

Hi,

I found program on sun...\Retrieving Mail with the JavaMail API and Working with the Java Communications API.mht for fetching mail

I copid it and compiled.

But It gives me error for "Fetch" program as

incompatible types for

Message message[]=folder.getMessages();

Can you tell me what I will do?

[343 byte] By [kripa_ostwala] at [2007-11-27 8:36:20]
# 1
Does the Java Communications API possibly define a Message type thatconflicts with the JavaMail Message type? If so, change your imports oruse a fully qualified class name.
bshannona at 2007-7-12 20:33:15 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
Dear Bshannon,Thanx,but can you explain it Please?
kripa_ostwala at 2007-7-12 20:33:15 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3

I know nothing about the Comm API.

Let's assume the Comm API defines a javax.comm.Message class.

If you have

import javax.comm.*;

import javax.mail.*;

which Message class is it going to use? The one from javax.comm?

Or the one from javax.mail? It will use the first one.

If you need to use both, you can say

javax.mail.Message[] msgs = folder.getMessages();

bshannona at 2007-7-12 20:33:15 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...