commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Flatoff Allan" <>
Subject RE: Commons - [email] Help
Date Mon, 29 Aug 2005 16:15:37 GMT
Hmm. . .

Couldn't you just catch the SendFailedException and generate your own
"mail delivery failure" message
To the sender?  Sounds like this is how you want it to behave.


-----Original Message-----
From: Sravan Duggaraju [] 
Sent: Monday, August 29, 2005 10:14 AM
Subject: Commons - email Help

Hi, I recently started Using commons email
(commons-email-SNAPSHOT.jar) for  send mail functionality.I am facing
the following problems.

1)In the To  field if i enter a wrong address of other domain it will
still send the mail, later it will inform me with "mail delivery
failure"...this is good. But it is not happening if i send a mail to
wrong email with in the same domain; it is immediately throwing

javax.mail.SendFailedException: Sending failed;
  nested exception is: 
	javax.mail.SendFailedException: Invalid Addresses;
  nested exception is: 
  ... User unknown

If I am not clear let me explain,

if i send a mail to then it is not
throwing any exception, later I am getting a email saying "delivery

but i send mail to then it is throwing
runtime exception. and it is not sending to other correct address
too......How to avoid this?

2)This is related to my question 1.
In To field i entered and in CC i entered still it is not sending to correct address
and throughing an exception.

	public static void sendMessage(String[] to,String[] cc, String
String subject, String content)
	  throws Exception {
		SimpleEmail email = new SimpleEmail();
		Collection toRecipients = new ArrayList();
	  	Collection ccRecipients = new ArrayList();
	  	//Create collection of To addresses
		    for (int i = 0; i < to.length; i++)
		        toRecipients.add(new InternetAddress(to[i],
//	  Create collection of To addresses
		    for (int i = 0; i < cc.length; i++)
		        ccRecipients.add(new InternetAddress(cc[i],

I apologize for the big mail.

I appreciate for any help

To unsubscribe, e-mail:
For additional commands, e-mail:

This e-mail is confidential.  If you are not the intended recipient, you must not disclose
or use the information contained in it.  If you have received this e-mail in error, please
tell us immediately by return e-mail to and delete the document.

E-mails containing unprofessional, discourteous or offensive remarks violate Sentry policy.
You may report employee violations by forwarding the message to

No recipient may use the information in this e-mail in violation of any civil or criminal
statute. Sentry disclaims all liability for any unauthorized uses of this e-mail or its contents.

This e-mail constitutes neither an offer nor an acceptance of any offer. No contract may be
entered into by a Sentry employee without express approval from an authorized Sentry manager.

Warning: Computer viruses can be transmitted via e-mail. Sentry accepts no liability or responsibility
for any damage caused by any virus transmitted with this e-mail.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message