Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 30465 invoked from network); 13 Jan 2005 13:52:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 13 Jan 2005 13:52:38 -0000 Received: (qmail 31059 invoked by uid 500); 13 Jan 2005 13:52:36 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 30991 invoked by uid 500); 13 Jan 2005 13:52:35 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 30978 invoked by uid 500); 13 Jan 2005 13:52:35 -0000 Received: (qmail 30975 invoked by uid 99); 13 Jan 2005 13:52:35 -0000 X-ASF-Spam-Status: No, hits=-9.2 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME,URIBL_SBL X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Thu, 13 Jan 2005 05:52:33 -0800 Received: (qmail 30436 invoked by uid 1909); 13 Jan 2005 13:52:32 -0000 Date: 13 Jan 2005 13:52:32 -0000 Message-ID: <20050113135232.30435.qmail@minotaur.apache.org> From: matzew@apache.org To: jakarta-commons-cvs@apache.org Subject: cvs commit: jakarta-commons/email/src/java/org/apache/commons/mail Email.java X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N matzew 2005/01/13 05:52:32 Modified: email project.xml email/src/java/org/apache/commons/mail Email.java Log: Closed bugzilla-ticket #32889 .thanks to Travis Meisenheimer for supporting this. Revision Changes Path 1.8 +176 -181 jakarta-commons/email/project.xml Index: project.xml =================================================================== RCS file: /home/cvs/jakarta-commons/email/project.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- project.xml 14 Dec 2004 09:40:55 -0000 1.7 +++ project.xml 13 Jan 2005 13:52:32 -0000 1.8 @@ -1,182 +1,177 @@ - - - Commons Email - commons-email - /images/email-logo-white.png - 2001 - Commons Email - Commons Email provides a simple wrapper over the Java Mail API - 1.0-rc2 - org.apache.commons.mail - jakarta - jakarta.apache.org - /www/jakarta.apache.org/commons/${pom.artifactId.substring(8)}/ - /www/jakarta.apache.org/builds/jakarta-commons/${pom.artifactId.substring(8)}/ - http://issues.apache.org/bugzilla/ - - scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:jakarta-commons/${pom.artifactId.substring(8)} - http://cvs.apache.org/viewcvs/jakarta-commons/${pom.artifactId.substring(8)}/ - - - - Commons Dev List - commons-dev-subscribe@jakarta.apache.org - commons-dev-unsubscribe@jakarta.apache.org - http://nagoya.apache.org/eyebrowse/SummarizeList?listName=commons-dev@jakarta.apache.org - - - Commons User List - commons-user-subscribe@jakarta.apache.org - commons-user-unsubscribe@jakarta.apache.org - http://nagoya.apache.org/eyebrowse/SummarizeList?listName=commons-user@jakarta.apache.org - - - - - dIon Gillard - dion - dion@multitask.com.au - Multitask Consulting - - - John McNally - jmcnally - jmcnally@collab.net - CollabNet, Inc. - - - Quinton McCombs - quintonm - quintonm@bellsouth.net - NequalsOne, LLC. - - - Eric Pugh - epugh - epugh@REMOVEMEopensourceconnections.com - OpenSource Connections - - - Daniel Rall - dlr - dlr@finemaltcoding.com - CollabNet, Inc. - - - Jon Scott Stevens - jon - jon@latchkey.com - CollabNet, Inc. - - - Jason van Zyl - jvanzyl - jason@zenplex.com - Zenplex - - - Joe Germuska - germuska - Joe@Germuska.com - - - - - - Matthias Wessendorf - matthias@wessendorf.net - - - Corey Scott - corey.scott@gmail.com - - - Mark Lowe - mark.lowe@boxstuff.com - - - Regis Koenigt - - - - - - - commons-lang - commons-lang - 2.0 - http://jakarta.apache.org/commons/lang.html - - - javamail - javamail - 1.3.2 - http://java.sun.com/products/javamail/ - - - activation - activation - 1.0.2 - http://java.sun.com/products/javabeans/glasgow/jaf.html - - - - dumbster - dumbster - 1.5 - - - - - src/java - src/test - - - - **/*Test.java - - - commons-dev@jakarta.apache.org - - - - NOTICE.txt - - - - - - - maven-changelog-plugin - maven-changes-plugin - maven-checkstyle-plugin - - maven-developer-activity-plugin - maven-file-activity-plugin - maven-javadoc-plugin - - maven-junit-report-plugin - maven-jxr-plugin - maven-pmd-plugin - maven-license-plugin - maven-jcoverage-plugin - - - - - + 1 + Commons Email + commons-email + commons-email + 1.0-rc2 + + 2001 + org.apache.commons.mail + /images/email-logo-white.png + jakarta + Commons Email provides a simple wrapper over the Java Mail API + Commons Email + http://issues.apache.org/bugzilla/ + jakarta.apache.org + /www/jakarta.apache.org/commons/${pom.artifactId.substring(8)}/ + /www/jakarta.apache.org/builds/jakarta-commons/${pom.artifactId.substring(8)}/ + + scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:jakarta-commons/${pom.artifactId.substring(8)} + http://cvs.apache.org/viewcvs/jakarta-commons/${pom.artifactId.substring(8)}/ + + + + + + Commons Dev List + commons-dev-subscribe@jakarta.apache.org + commons-dev-unsubscribe@jakarta.apache.org + http://nagoya.apache.org/eyebrowse/SummarizeList?listName=commons-dev@jakarta.apache.org + + + Commons User List + commons-user-subscribe@jakarta.apache.org + commons-user-unsubscribe@jakarta.apache.org + http://nagoya.apache.org/eyebrowse/SummarizeList?listName=commons-user@jakarta.apache.org + + + + + dIon Gillard + dion + dion@multitask.com.au + Multitask Consulting + + + + John McNally + jmcnally + jmcnally@collab.net + CollabNet, Inc. + + + + Quinton McCombs + quintonm + quintonm@bellsouth.net + NequalsOne, LLC. + + + + Eric Pugh + epugh + epugh@REMOVEMEopensourceconnections.com + OpenSource Connections + + + + Daniel Rall + dlr + dlr@finemaltcoding.com + CollabNet, Inc. + + + + Jon Scott Stevens + jon + jon@latchkey.com + CollabNet, Inc. + + + + Jason van Zyl + jvanzyl + jason@zenplex.com + Zenplex + + + + Joe Germuska + germuska + Joe@Germuska.com + + + + + + Matthias Wessendorf + matthias@wessendorf.net + + + + Corey Scott + corey.scott@gmail.com + + + + Mark Lowe + mark.lowe@boxstuff.com + + + + Regis Koenigt + + + + + + commons-lang + commons-lang + 2.0 + http://jakarta.apache.org/commons/lang.html + + + + javamail + javamail + 1.3.2 + http://java.sun.com/products/javamail/ + + + + activation + activation + 1.0.2 + http://java.sun.com/products/javabeans/glasgow/jaf.html + + + + dumbster + dumbster + 1.5 + + + + + commons-dev@jakarta.apache.org + src/java + src/test + + + **/*Test.java + + + + + + NOTICE.txt + + false + + + + + maven-changelog-plugin + maven-changes-plugin + maven-checkstyle-plugin + maven-developer-activity-plugin + maven-file-activity-plugin + maven-javadoc-plugin + maven-junit-report-plugin + maven-jxr-plugin + maven-pmd-plugin + maven-license-plugin + maven-jcoverage-plugin + + + \ No newline at end of file 1.4 +108 -4 jakarta-commons/email/src/java/org/apache/commons/mail/Email.java Index: Email.java =================================================================== RCS file: /home/cvs/jakarta-commons/email/src/java/org/apache/commons/mail/Email.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Email.java 3 Dec 2004 17:10:37 -0000 1.3 +++ Email.java 13 Jan 2005 13:52:32 -0000 1.4 @@ -13,15 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.commons.mail; + import java.util.ArrayList; import java.util.Collection; import java.util.Date; import java.util.Enumeration; import java.util.Hashtable; import java.util.Properties; - + import javax.mail.Authenticator; import javax.mail.Message; import javax.mail.MessagingException; @@ -49,6 +51,7 @@ * @author Colin Chalmers * @author Matthias Wessendorf * @author Corey Scott + * @author Travis Meisenheimer * @version $Revision$ $Date$ * @version $Id$ */ @@ -498,6 +501,39 @@ } /** + * Set a list of "TO" addresses using String [] + * + * @param to a String [] of addressess {"joe@blow.com", "dick@blow.com"} + * @return An Email. + * @throws AddressException Indicates an invalid email address + * + */ + + public Email setTo(String [] to) throws EmailException { + for (int i = 0; i < to.length; i++) + this.toList.add( createInternetAddress( to[i], null ) ); + + return this; + } + + /** + * Set a list of "TO" addresses using String [][] + * + * @param to a String [][] of addressess {{"joe@blow.com", "Joe Blow"}, { "dick@blow.com", "Dick Blow"}} + * @return An Email. + * @throws AddressException Indicates an invalid email address + * + */ + + public Email setTo(String [][] to) throws EmailException { + for (int i = 0; i < to.length; i++) + this.toList.add( createInternetAddress( to[i][0], to[i][1] ) ); + + return this; + } + + + /** * Add a recipient CC to the email. * * @param email A String. @@ -545,6 +581,41 @@ return this; } + + + /** + * Set a list of "CC" addresses using String [] + * + * @param cc a String [] of addressess {"joe@blow.com", "dick@blow.com"} + * @return An Email. + * @throws AddressException Indicates an invalid email address + * + */ + + public Email setCc(String [] cc) throws EmailException { + for (int i = 0; i < cc.length; i++) + this.ccList.add( createInternetAddress( cc[i], null ) ); + + return this; + } + + /** + * Set a list of "CC" addresses using String [][] + * + * @param cc a String [][] of addressess {{"joe@blow.com", "Joe Blow"}, { "dick@blow.com", "Dick Blow"}} + * @return An Email. + * @throws AddressException Indicates an invalid email address + * + */ + + public Email setCc(String [][] cc) throws EmailException { + for (int i = 0; i < cc.length; i++) + this.ccList.add( createInternetAddress( cc[i][0], cc[i][1] ) ); + + return this; + } + + /** * Add a blind BCC recipient to the email. * @@ -593,6 +664,39 @@ return this; } + + /** + * Set a list of "BCC" addresses using String [] + * + * @param bcc a String [] of addressess {"joe@blow.com", "dick@blow.com"} + * @return An Email. + * @throws AddressException Indicates an invalid email address + * + */ + + public Email setBcc(String [] bcc) throws EmailException { + for (int i = 0; i < bcc.length; i++) + this.bccList.add( createInternetAddress( bcc[i], null ) ); + + return this; + } + + /** + * Set a list of "BCC" addresses using String [][] + * + * @param bcc a String [][] of addressess {{"joe@blow.com", "Joe Blow"}, { "dick@blow.com", "Dick Blow"}} + * @return An Email. + * @throws AddressException Indicates an invalid email address + * + */ + + public Email setBcc(String [][] bcc) throws EmailException { + for (int i = 0; i < bcc.length; i++) + this.bccList.add( createInternetAddress( bcc[i][0], bcc[i][1] ) ); + + return this; + } + /** * Add a reply to address to the email. * @@ -887,4 +991,4 @@ this.popUsername = newPopUsername; this.popPassword = newPopPassword; } -} +} \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org