commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marty Phee <mp...@jump-technologies.com>
Subject Re: Urgent:::commons-email
Date Tue, 17 Aug 2004 22:09:17 GMT
Download the souce code.  It looks like they should be InternetAddress objects 
in the collection and not strings.


On Tuesday 17 August 2004 04:27 pm, rose maria wrote:
> Hi,
> I was able to send a mail by using SimpleEmail class
> of commons-email when i used the following code
>
> 		SimpleEmail email = new SimpleEmail();
> 		email.setDebug(true);
> 		email.setHostName("test.myhost.com");
>
>       ---->>>>
> email.addTo("jinimaria@yahoo.com,Maria");
>
> 		email.setFrom("me@mycompany.com", "Me");
> 		email.setMsg("This is a simple test For mail");
> 		email.send();
>
> but it is not working when i tried to use with a
> Collection that is  i replaced "addTo" with "setTo".It
> is not
> giving any error.Code is as folloing
>
> 	  	Collection c = new ArrayList();
> 	  	c.add("jinimaria@yahoo.com");
> 		email.setDebug(true);
> 		email.setHostName("test.myhost.com");
>       ---->>>>	email.setTo(c);
> 		email.setFrom("me@mycompany.com", "Me");
> 		email.setMsg("This is a simple test For
> collection");
> 		email.send();
>    Am i missing somthing here.Itried both with
> commons-email-0.1-dev.jar and
> commons-email-SNAPSHOT.jar
>
>    Please include a code snippet if you have any...
>
>    Your help would be greatly appreciated.
>
>    Thanks
>    Maria
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message