This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

smtp

 
nishesh chouhan
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic