postMail method does not work

postMail method throws this exception "Could not send email". This exception occurs at this line of code "Transport.send(msg)". Does anyone have any idea ?

publicvoid postMail( String recipients[ ], String subject,

String message , String from)throws MessagingException,IOException

{

boolean debug =false;

//Set the host smtp address

Properties props =new Properties();

props.put("mail.smtp.host", smtpHostName);// smtpHostName = "mail.isentric.com"

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

Authenticator auth =new SMTPAuthenticator();

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

session.setDebug(debug);

// create a message

Message msg =new MimeMessage(session);

// set the from and to address

InternetAddress addressFrom =new InternetAddress(from);

msg.setFrom(addressFrom);

InternetAddress[] addressTo =new InternetAddress[recipients.length];

for (int i = 0; i < recipients.length; i++)

{

addressTo[i] =new InternetAddress(recipients[i]);

System.out.println("Attempting to send email to: " + recipients[i]);

}

msg.setRecipients(Message.RecipientType.TO, addressTo);

// Setting the Subject and Content Type

msg.setSubject(subject);

msg.setContent(message,"text/plain");

Transport.send(msg);// Error : Unable to send

System.out.println("Successfully sent mail to all in list");

}

[2360 byte] By [shamexa] at [2007-11-27 9:38:26]
# 1
I need more details on the exception. The protocol trace might be helpfulas well. See the JavaMail FAQ.
bshannona at 2007-7-12 23:11:49 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
This was the exception "javax.mail.MessagingException: Could not connect to SMTP host : mail.isentric.com, port:25"I have checked the VirusScan and removed the protection of port 25. But , it still throw same exception.
shamexa at 2007-7-12 23:11:49 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3
Well, I can't connect either so most likely that machine isn't running an SMTPserver on the standard port. If you think they should be running a mail server,you'll need to contact the administrator of that site to get the required connectioninformation.
bshannona at 2007-7-12 23:11:49 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4
I will try to find the solution. Thank you for the solution
shamexa at 2007-7-12 23:11:49 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 5
I will try to find the solution. Thank you for your time
shamexa at 2007-7-12 23:11:49 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...