dcsimg
problems reading mail
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   parag_medsinge
Posted On:   Saturday, March 24, 2001 10:57 PM

here is a query for one problem i am facing. i have put the trace with this. i want to check my email account at yahoo can you help me in solving this problem (yahoo supports pop & imap , i have tested with this with imap) can you also tell me apart form yahoo where i can test pop3 or imap protocol. ********************************** code sample public class copier { public static void main(String argv[]) { boolean debug = false;// change to get more errors try { URLName url = new URLName("imap","imap.satyam.net.in",-1,"inbox","sai_alapati@yahoo.com","guughjhg"); Session session = Session   More>>

here is a query for one problem i am facing. i have put the trace with this.
i want to check my email account at yahoo can you help me in solving this problem
(yahoo supports pop & imap , i have tested with this with imap)
can you also tell me apart form yahoo where i can test pop3 or imap protocol.

**********************************
code sample

public class copier {

public static void main(String argv[]) {
boolean debug = false;// change to get more errors


try {
URLName url = new URLName("imap","imap.satyam.net.in",-1,"inbox","sai_alapati@yahoo.com","guughjhg");
Session session = Session.getDefaultInstance(
System.getProperties(), null);
session.setDebug(debug);

Store store = session.getStore(url);
store.connect();
System.out.println("Connected...");


Folder folder = store.getFolder("inbox");
folder.open(Folder.READ_WRITE);
System.out.println("Opened source...");

if (folder.getMessageCount() == 0) {
System.out.println("Source folder has no messages ..");
folder.close(false);
store.close();
}

// Open destination folder, create if needed
Folder dfolder = store.getFolder("sai");
if (!dfolder.exists()) // create
dfolder.create(Folder.HOLDS_MESSAGES);
System.out.println("Opened dest...");

Message[] msgs = folder.getMessages(1, 2);
System.out.println("Got messages...");

// Copy messages into destination,
folder.copyMessages(msgs, dfolder);
System.out.println("Copied messages...");

// Close the folders and store
folder.close(false);
dfolder.close(false);
store.close();
System.out.println("Closed folders and store...");

} catch (Exception e) {
e.printStackTrace();
}

System.exit(0);
}

}



trace:

C:jdk1.3 injava.exe copier
Working Directory - C:mailtest
Class Path - D:Program FilesSybaseJaguar CTS 3.5htmlclasses;D:Program FilesSybaseJaguar CTS 3.5javaclasses;D:Program FilesSybaseSharedSunjdk118libclasses.zip;D:Program FilesSybaseSharedPowerBuilderclasses.zip;.;D:OracleOra81orbclassesyoj.jar;D:OracleOra81orbclassesshare.zip;D:javamail-1.2demo;D:javamail-1.2mail.jar;D:jaf-1.0.1activation.jar;c:kawa4.1kawaclasses.zip;c:jdk1.3lib ools.jar;c:jdk1.3jrelib
t.jar;c:jdk1.3jrelibi18n.jar;D:jaxp-1.1jaxp.jar;D:jaxp-1.1xalan.jar

DEBUG: getProvider() returning javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc] * OK Courier-IMAP ready. Copyright 1998-2000 Double Precision, Inc. See COPYING for distribution information. A0 CAPABILITY * CAPABILITY IMAP4rev1 CHILDREN NAMESPACE THREAD-ORDEREDSUBJECT SORT A0 OK CAPABILITY completed A1 LOGIN sai_alapati@yahoo.com clsjuky A1 NO Login failed. javax.mail.AuthenticationFailedException at javax.mail.Service.connect(Service.java:250) at javax.mail.Service.connect(Service.java:131) at javax.mail.Service.connect(Service.java:87) at copier.main(copier.java:76) Process Exit...

   <<Less
About | Sitemap | Contact