dcsimg
java mail
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   pranjali_bhatia
Posted On:   Saturday, September 21, 2002 12:37 AM

i wrote a prog implementing pop3client..i used store object passing the provider name to connect..i can cnncet using the ip address but when i give the host name as mail.hathway.com as parameter in the connect method , i dont get connected and no exception is thrown. my code is as foloows: Properties props = System.getProperties(); String host = "202.88.149.6"; String username = "sanklan@hathway.com"; String password = "sanklan"; String provider = "pop3"; session = Session.getDefaultInstance(props, null); store = session.getStore(provider); store.connect(host, username, password); if (store.isConnected()) System.out.println(&q   More>>

i wrote a prog implementing pop3client..i used store object passing the provider name to connect..i can cnncet using the ip address but when i give the host name as mail.hathway.com as parameter in the connect method , i dont get connected and no exception is thrown.


my code is as foloows:
Properties props = System.getProperties();
String host = "202.88.149.6";
String username = "sanklan@hathway.com";
String password = "sanklan";
String provider = "pop3";
session = Session.getDefaultInstance(props, null);
store = session.getStore(provider);
store.connect(host, username, password);
if (store.isConnected())
System.out.println("u have successfully logged in");
else
System.out.println("sorry");


it gets connected this way but
kindly tell me how i can connect ny giving thr host name instead of its ip address

   <<Less

Re: java mail

Posted By:   Christopher_Koenigsberg  
Posted On:   Monday, September 23, 2002 07:50 AM

Is there a DNS problem? Does your machine where this code is running have DNS access, and is there an A record in DNS, resolving the host name in question, to that IP address?



Can you use a command line, on the machine where your code is running, to get to that host by the name, i.e. "ping", "telnet" etc.?

About | Sitemap | Contact