You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by rose maria <ji...@yahoo.com> on 2004/08/17 23:27:31 UTC
Urgent:::commons-email
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
Re: Urgent:::commons-email
Posted by Marty Phee <mp...@jump-technologies.com>.
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