Hi,
How to catch the response from the mail sever the scenerio is suppose if we give the recepients mail id is wrong at that time we have to catch the exception that the recepients id is wrong.How to solve that issue.Here i am posting the example that i have done.I am not able to catch that Exception...

import java.util.ArrayList;
import java.util.List;

import javax.mail.internet.InternetAddress;

import org.apache.commons.mail.HtmlEmail;

public class MailSenderCheck{

public static void main(String[]args){
HtmlEmail htmlEmail=new HtmlEmail();
try{
List toAddresses = new ArrayList();
String hostAddress="12.834.1.2";
String fromAddress="dil@gmail.com";
String subject="Test Email";
String toAddress="rel@gmail.com";
String body="<html><body><marquee>Hi Venkat</marquee></body></html>";
HtmlEmail email = new HtmlEmail();
email.setHostName(hostAddress);
InternetAddress[] internetToAddressList = InternetAddress.parse(toAddress);
email.setFrom(fromAddress);
email.setSubject(subject);
toAddresses.add(internetToAddressList[0]);
email.setTo(toAddresses);
email.setHtmlMsg(body.toString());
//InternetAddress[] internetToAddressList = InternetAddress.parse(toAddress);
//email.setTo(toAddress);
email.send();
System.out.println("Mail Sending Succesfull");
}catch(Exception ex){
System.out.println("Mail Sending Failed:");
ex.printStackTrace();


}

}

}

Pls help me out to solve this issue