aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes smtp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "smtp " Watch "smtp " New topic
Author

smtp

nishesh chouhan
Ranch Hand

Joined: Nov 06, 2000
Posts: 37
sir
is there any facility in java which detects smtp(isp's dns) to which we r connected. ur reply will help me cmpleting my project.
thanx
Venkat Ammisetty
Ranch Hand

Joined: Nov 25, 2000
Posts: 42
import javax.mail.*;
import java.util.*;
class ListProvider
{
public static void main(String[] args)
{
Properties props=System.getProperties();
Session session=Session.getInstance(props,null);
Provider[] providers=session.getProviders();
for (int i=0;i < providers.length;++i )
{
System.out.println(providers[i]);
}

}
}

Just compile and run this program.
You will get the list of SMTP server's list(If exits)
Bye
Venkat

[This message has been edited by Carl Trusiak (edited December 11, 2000).]


Venkat Ammisetty
Venkat Ammisetty
Ranch Hand

Joined: Nov 25, 2000
Posts: 42
Sorry Chouhan
Even thought I copied two times that for loop it is incomplete.
Here it is
for (int i=0;i < providers.length;++i )
{
System.out.println(providers[ i ]);
}

(It was the < that was causing that, I edoted the code to show.....Carl)
[This message has been edited by Carl Trusiak (edited December 11, 2000).]
 
 
subject: smtp