Can u check it why it gives error ?

This is my code.

why its not running even if i changed domain.

it gives error : whether adress is not valid or connection refused.

whats the problem ....

please help me

import java.io.*;

import java.net.InetAddress;

import java.util.Properties;

import java.util.Date;

import javax.mail.*;

import javax.mail.internet.*;

public class SendMail

{

public static void main(String[] argv) throws Exception

{

String host = "mail.aditechinfosys.com";

String from = "dhiren@aditechinfosys.com";

String to = " pradip5prince@yahoo.com";

try {

// Get system properties

Properties props = System.getProperties();

// Setup mail server

props.put("mail.smtp.host", host);

props.put("mail.smtp.starttls.enable", "true");

//props.put("mail.smtp.auth","true");

// Get session

Authenticator auth = new MyAuthenticator();

Session session = Session.getDefaultInstance(props, null);

// Define message

MimeMessage message = new MimeMessage(session);

message.setFrom(new InternetAddress(from));

message.addRecipient(Message.RecipientType.TO,new InternetAddress(to));

message.setSubject("Hello JavaMail");

message.setText("Welcome to JavaMail, by ghanshyam");

// Send message

//com.sun.mail.smtp.SMTPSSLTransport.send(message);

Transport.send(message);

}catch(Exception e) { System.out.println(e); }

System.out.println("Sent successfully !");

}

}

class MyAuthenticator extends Authenticator

{

MyAuthenticator()

{

super();

}

protected PasswordAuthentication getPasswordAuthentication()

{

return new PasswordAuthentication("dhiren", "pw");

}

}

[1827 byte] By [Ghanshyama] at [2007-10-3 0:17:41]
# 1
Read the JavaMail FAQ.Turn on session debugging and send the protocol trace.
bshannona at 2007-7-14 17:08:44 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...