How to get name of default mail server?
Hi , I need to get the name of default mail server . In 1.5 i can get this usingSystem.getenv("MAIL_SERVER");.How do i get this in 1.4?Since getenv() is depricated in 1.4 , how can i get the name of mail server in 1.4?plz help me....
# 1
> How do i get this in 1.4?
Pass the environment variable to your JVM (windows) with the -D parameter
java -Dmail_server="%MAIL_SERVER%" myClass
then in your code
String mail_server = System.getProperty("mail_server");
--
http://www.rgagnon.com/howto.html
# 2
"MAIL_SERVER" is not a standard environment variable, but if somethingin your environment is setting it, you can still use System.getenv in 1.4to retrieve it.
# 4
If you use "MAIL_SERVER" in 1.5, use "MAIL_SERVER" in 1.4.As far as I know, nothing in the JDK is setting this variable. If it'sbeing set at all, it's being set by something outside of Java.