purna.vaasireddy
09-15-2009, 08:54 AM
Hi,
I am Getting com.jscape.inet.pop.PopException while trying to extract mail from gmail through java application.
Below is the code:
import com.jscape.inet.email.*;
import com.jscape.inet.popssl.*;
public class Sample {
public static void main(String[] args) {
String hostname = "pop.gmail.com";
String username = "abcd@gmail.com";
String password = "abcd";
try {
// create new PopSsl instance
PopSsl ssl = new PopSsl(hostname,username, password);
ssl.setDebug(true);
// establish SSL/TLS connection
ssl.connect();
// get message count
int count = ssl.getMessageCount();
// get each message and print subject
for (int i = 1; i <= count; ++i) {
EmailMessage msg = ssl.getMessage(i);
System.out.println("Subject: " + msg.getSubject());
}
// disconnect
ssl.disconnect();
} catch (Exception e) {
e.printStackTrace();
}
}
}
i included sinetfactory.jar in build path.
please help me in this.
provide me the solution and necessary settings.
Purna.
I am Getting com.jscape.inet.pop.PopException while trying to extract mail from gmail through java application.
Below is the code:
import com.jscape.inet.email.*;
import com.jscape.inet.popssl.*;
public class Sample {
public static void main(String[] args) {
String hostname = "pop.gmail.com";
String username = "abcd@gmail.com";
String password = "abcd";
try {
// create new PopSsl instance
PopSsl ssl = new PopSsl(hostname,username, password);
ssl.setDebug(true);
// establish SSL/TLS connection
ssl.connect();
// get message count
int count = ssl.getMessageCount();
// get each message and print subject
for (int i = 1; i <= count; ++i) {
EmailMessage msg = ssl.getMessage(i);
System.out.println("Subject: " + msg.getSubject());
}
// disconnect
ssl.disconnect();
} catch (Exception e) {
e.printStackTrace();
}
}
}
i included sinetfactory.jar in build path.
please help me in this.
provide me the solution and necessary settings.
Purna.