commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject cvs commit: jakarta-commons/email/src/java/org/apache/commons/mail Email.java
Date Thu, 13 Jan 2005 13:52:32 GMT
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 @@
  -<?xml version="1.0" encoding="UTF-8"?>
  -<!--
  -   Copyright 2001-2004 The Apache Software Foundation
  -
  -   Licensed under the Apache License, Version 2.0 (the "License");
  -   you may not use this file except in compliance with the License.
  -   You may obtain a copy of the License at
  -
  -       http://www.apache.org/licenses/LICENSE-2.0
  -
  -   Unless required by applicable law or agreed to in writing, software
  -   distributed under the License is distributed on an "AS IS" BASIS,
  -   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  -   See the License for the specific language governing permissions and
  -   limitations under the License.
  --->
   <project>
  -  <name>Commons Email</name>
  -  <id>commons-email</id>
  -  <logo>/images/email-logo-white.png</logo>
  -  <inceptionYear>2001</inceptionYear>
  -  <shortDescription>Commons Email</shortDescription>
  -  <description>Commons Email provides a simple wrapper over the Java Mail API</description>
  -  <currentVersion>1.0-rc2</currentVersion>
  -  <package>org.apache.commons.mail</package>
  -  <gumpRepositoryId>jakarta</gumpRepositoryId>
  -  <siteAddress>jakarta.apache.org</siteAddress>
  -  <siteDirectory>/www/jakarta.apache.org/commons/${pom.artifactId.substring(8)}/</siteDirectory>
  -  <distributionDirectory>/www/jakarta.apache.org/builds/jakarta-commons/${pom.artifactId.substring(8)}/</distributionDirectory>
  -  <issueTrackingUrl>http://issues.apache.org/bugzilla/</issueTrackingUrl>
  -  <repository>
  -    <connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:jakarta-commons/${pom.artifactId.substring(8)}</connection>
  -    <url>http://cvs.apache.org/viewcvs/jakarta-commons/${pom.artifactId.substring(8)}/</url>
  -  </repository>
  -  <mailingLists>
  -    <mailingList>
  -      <name>Commons Dev List</name>
  -      <subscribe>commons-dev-subscribe@jakarta.apache.org</subscribe>
  -      <unsubscribe>commons-dev-unsubscribe@jakarta.apache.org</unsubscribe>
  -      <archive>http://nagoya.apache.org/eyebrowse/SummarizeList?listName=commons-dev@jakarta.apache.org</archive>
  -    </mailingList>
  -    <mailingList>
  -      <name>Commons User List</name>
  -      <subscribe>commons-user-subscribe@jakarta.apache.org</subscribe>
  -      <unsubscribe>commons-user-unsubscribe@jakarta.apache.org</unsubscribe>
  -      <archive>http://nagoya.apache.org/eyebrowse/SummarizeList?listName=commons-user@jakarta.apache.org</archive>
  -    </mailingList>
  -  </mailingLists>
  -  <developers>
  -    <developer>
  -      <name>dIon Gillard</name>
  -      <id>dion</id>
  -      <email>dion@multitask.com.au</email>
  -      <organization>Multitask Consulting</organization>
  -    </developer>
  -    <developer>
  -      <name>John McNally</name>
  -      <id>jmcnally</id>
  -      <email>jmcnally@collab.net</email>
  -      <organization>CollabNet, Inc.</organization>
  -    </developer>
  -    <developer>
  -      <name>Quinton McCombs</name>
  -      <id>quintonm</id>
  -      <email>quintonm@bellsouth.net</email>
  -      <organization>NequalsOne, LLC.</organization>
  -    </developer>
  -    <developer>
  -      <name>Eric Pugh</name>
  -      <id>epugh</id>
  -      <email>epugh@REMOVEMEopensourceconnections.com</email>
  -      <organization>OpenSource Connections</organization>
  -    </developer>    
  -    <developer>
  -      <name>Daniel Rall</name>
  -      <id>dlr</id>
  -      <email>dlr@finemaltcoding.com</email>
  -      <organization>CollabNet, Inc.</organization>
  -    </developer>
  -    <developer>
  -      <name>Jon Scott Stevens</name>
  -      <id>jon</id>
  -      <email>jon@latchkey.com</email>
  -      <organization>CollabNet, Inc.</organization>
  -    </developer>
  -    <developer>
  -      <name>Jason van Zyl</name>
  -      <id>jvanzyl</id>
  -      <email>jason@zenplex.com</email>
  -      <organization>Zenplex</organization>
  -    </developer>
  -    <developer>
  -      <name>Joe Germuska</name>
  -      <id>germuska</id>
  -      <email>Joe@Germuska.com</email>
  -    </developer>
  -  </developers>
  -
  -  <contributors>
  -    <contributor>
  -      <name>Matthias Wessendorf</name>
  -      <email>matthias@wessendorf.net</email>
  -    </contributor>
  -    <contributor>
  -      <name>Corey Scott</name>
  -      <email>corey.scott@gmail.com</email>
  -    </contributor>
  -	<contributor>
  -      <name>Mark Lowe</name>
  -      <email>mark.lowe@boxstuff.com</email>
  -    </contributor>
  -	<contributor>
  -      <name>Regis Koenigt</name>
  -      <email></email>
  -    </contributor>
  -  </contributors>
  -  
  -  <dependencies>
  -    <dependency>
  -      <groupId>commons-lang</groupId>
  -      <artifactId>commons-lang</artifactId>      
  -      <version>2.0</version>
  -      <url>http://jakarta.apache.org/commons/lang.html</url>
  -    </dependency>  
  -    <dependency>
  -      <groupId>javamail</groupId>
  -      <artifactId>javamail</artifactId>      
  -      <version>1.3.2</version>
  -      <url>http://java.sun.com/products/javamail/</url>
  -    </dependency>
  -    <dependency>
  -      <groupId>activation</groupId>
  -      <artifactId>activation</artifactId>      
  -      <version>1.0.2</version>
  -      <url>http://java.sun.com/products/javabeans/glasgow/jaf.html</url>
  -    </dependency>
  -    <!-- Needed for testing -->  
  -    <dependency>
  -      <groupId>dumbster</groupId>
  -      <artifactId>dumbster</artifactId>      
  -      <version>1.5</version>
  -    </dependency>    
  -  </dependencies>
  -
  -  <build>
  -    <sourceDirectory>src/java</sourceDirectory>
  -    <unitTestSourceDirectory>src/test</unitTestSourceDirectory>
  -    <aspectSourceDirectories/>
  -    <unitTest>
  -      <includes>
  -        <include>**/*Test.java</include>
  -      </includes>
  -    </unitTest>
  -    <nagEmailAddress>commons-dev@jakarta.apache.org</nagEmailAddress>
  -    <resources>
  -      <resource>
  -        <includes>
  -          <include>NOTICE.txt</include>
  -        </includes>
  -      </resource>
  -    </resources>	
  -  </build>
  -  
  -  <reports>
  -     <report>maven-changelog-plugin</report>
  -     <report>maven-changes-plugin</report>
  -     <report>maven-checkstyle-plugin</report>
  -     <!--report>maven-clover-plugin</report-->
  -     <report>maven-developer-activity-plugin</report>
  -     <report>maven-file-activity-plugin</report>
  -     <report>maven-javadoc-plugin</report>
  -     <!--report>maven-jellydoc-plugin</report-->
  -     <report>maven-junit-report-plugin</report>
  -     <report>maven-jxr-plugin</report>
  -     <report>maven-pmd-plugin</report>
  -     <report>maven-license-plugin</report>
  -     <report>maven-jcoverage-plugin</report>
  -     <!--report>maven-linkcheck-plugin</report-->
  -     <!--report>maven-statcvs-plugin</report-->
  -     <!--report>maven-tasklist-plugin</report-->
  -  </reports>
  -</project>
  +    <pomVersion>1</pomVersion>
  +    <name>Commons Email</name>
  +    <groupId>commons-email</groupId>
  +    <artifactId>commons-email</artifactId>
  +    <currentVersion>1.0-rc2</currentVersion>
  +    <organization/>
  +    <inceptionYear>2001</inceptionYear>
  +    <package>org.apache.commons.mail</package>
  +    <logo>/images/email-logo-white.png</logo>
  +    <gumpRepositoryId>jakarta</gumpRepositoryId>
  +    <description>Commons Email provides a simple wrapper over the Java Mail API</description>
  +    <shortDescription>Commons Email</shortDescription>
  +    <issueTrackingUrl>http://issues.apache.org/bugzilla/</issueTrackingUrl>
  +    <siteAddress>jakarta.apache.org</siteAddress>
  +    <siteDirectory>/www/jakarta.apache.org/commons/${pom.artifactId.substring(8)}/</siteDirectory>
  +    <distributionDirectory>/www/jakarta.apache.org/builds/jakarta-commons/${pom.artifactId.substring(8)}/</distributionDirectory>
  +    <repository>
  +        <connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:jakarta-commons/${pom.artifactId.substring(8)}</connection>
  +        <url>http://cvs.apache.org/viewcvs/jakarta-commons/${pom.artifactId.substring(8)}/</url>
  +    </repository>
  +    <versions/>
  +    <branches/>
  +    <mailingLists>
  +        <mailingList>
  +            <name>Commons Dev List</name>
  +            <subscribe>commons-dev-subscribe@jakarta.apache.org</subscribe>
  +            <unsubscribe>commons-dev-unsubscribe@jakarta.apache.org</unsubscribe>
  +            <archive>http://nagoya.apache.org/eyebrowse/SummarizeList?listName=commons-dev@jakarta.apache.org</archive>
  +        </mailingList>
  +        <mailingList>
  +            <name>Commons User List</name>
  +            <subscribe>commons-user-subscribe@jakarta.apache.org</subscribe>
  +            <unsubscribe>commons-user-unsubscribe@jakarta.apache.org</unsubscribe>
  +            <archive>http://nagoya.apache.org/eyebrowse/SummarizeList?listName=commons-user@jakarta.apache.org</archive>
  +        </mailingList>
  +    </mailingLists>
  +    <developers>
  +        <developer>
  +            <name>dIon Gillard</name>
  +            <id>dion</id>
  +            <email>dion@multitask.com.au</email>
  +            <organization>Multitask Consulting</organization>
  +            <roles/>
  +        </developer>
  +        <developer>
  +            <name>John McNally</name>
  +            <id>jmcnally</id>
  +            <email>jmcnally@collab.net</email>
  +            <organization>CollabNet, Inc.</organization>
  +            <roles/>
  +        </developer>
  +        <developer>
  +            <name>Quinton McCombs</name>
  +            <id>quintonm</id>
  +            <email>quintonm@bellsouth.net</email>
  +            <organization>NequalsOne, LLC.</organization>
  +            <roles/>
  +        </developer>
  +        <developer>
  +            <name>Eric Pugh</name>
  +            <id>epugh</id>
  +            <email>epugh@REMOVEMEopensourceconnections.com</email>
  +            <organization>OpenSource Connections</organization>
  +            <roles/>
  +        </developer>
  +        <developer>
  +            <name>Daniel Rall</name>
  +            <id>dlr</id>
  +            <email>dlr@finemaltcoding.com</email>
  +            <organization>CollabNet, Inc.</organization>
  +            <roles/>
  +        </developer>
  +        <developer>
  +            <name>Jon Scott Stevens</name>
  +            <id>jon</id>
  +            <email>jon@latchkey.com</email>
  +            <organization>CollabNet, Inc.</organization>
  +            <roles/>
  +        </developer>
  +        <developer>
  +            <name>Jason van Zyl</name>
  +            <id>jvanzyl</id>
  +            <email>jason@zenplex.com</email>
  +            <organization>Zenplex</organization>
  +            <roles/>
  +        </developer>
  +        <developer>
  +            <name>Joe Germuska</name>
  +            <id>germuska</id>
  +            <email>Joe@Germuska.com</email>
  +            <roles/>
  +        </developer>
  +    </developers>
  +    <contributors>
  +        <contributor>
  +            <name>Matthias Wessendorf</name>
  +            <email>matthias@wessendorf.net</email>
  +            <roles/>
  +        </contributor>
  +        <contributor>
  +            <name>Corey Scott</name>
  +            <email>corey.scott@gmail.com</email>
  +            <roles/>
  +        </contributor>
  +        <contributor>
  +            <name>Mark Lowe</name>
  +            <email>mark.lowe@boxstuff.com</email>
  +            <roles/>
  +        </contributor>
  +        <contributor>
  +            <name>Regis Koenigt</name>
  +            <roles/>
  +        </contributor>
  +    </contributors>
  +    <dependencies>
  +        <dependency>
  +            <groupId>commons-lang</groupId>
  +            <artifactId>commons-lang</artifactId>
  +            <version>2.0</version>
  +            <url>http://jakarta.apache.org/commons/lang.html</url>
  +            <properties/>
  +        </dependency>
  +        <dependency>
  +            <groupId>javamail</groupId>
  +            <artifactId>javamail</artifactId>
  +            <version>1.3.2</version>
  +            <url>http://java.sun.com/products/javamail/</url>
  +            <properties/>
  +        </dependency>
  +        <dependency>
  +            <groupId>activation</groupId>
  +            <artifactId>activation</artifactId>
  +            <version>1.0.2</version>
  +            <url>http://java.sun.com/products/javabeans/glasgow/jaf.html</url>
  +            <properties/>
  +        </dependency>
  +        <dependency>
  +            <groupId>dumbster</groupId>
  +            <artifactId>dumbster</artifactId>
  +            <version>1.5</version>
  +            <properties/>
  +        </dependency>
  +    </dependencies>
  +    <build>
  +        <nagEmailAddress>commons-dev@jakarta.apache.org</nagEmailAddress>
  +        <sourceDirectory>src/java</sourceDirectory>
  +        <unitTestSourceDirectory>src/test</unitTestSourceDirectory>
  +        <unitTest>
  +            <includes>
  +                <include>**/*Test.java</include>
  +            </includes>
  +        </unitTest>
  +        <resources>
  +            <resource>
  +                <includes>
  +                    <include>NOTICE.txt</include>
  +                </includes>
  +                <filtering>false</filtering>
  +            </resource>
  +        </resources>
  +    </build>
  +    <reports>
  +        <report>maven-changelog-plugin</report>
  +        <report>maven-changes-plugin</report>
  +        <report>maven-checkstyle-plugin</report>
  +        <report>maven-developer-activity-plugin</report>
  +        <report>maven-file-activity-plugin</report>
  +        <report>maven-javadoc-plugin</report>
  +        <report>maven-junit-report-plugin</report>
  +        <report>maven-jxr-plugin</report>
  +        <report>maven-pmd-plugin</report>
  +        <report>maven-license-plugin</report>
  +        <report>maven-jcoverage-plugin</report>
  +    </reports>
  +    <properties/>
  +</project>
  \ 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 <a href="mailto:colin.chalmers@maxware.nl">Colin Chalmers</a>
    * @author <a href="mailto:matthias@wessendorf.net">Matthias Wessendorf</a>
    * @author <a href="mailto:corey.scott@gmail.com">Corey Scott</a>
  + * @author <a href="mailto:travis@thirdeyemedia.net">Travis Meisenheimer</a>
    * @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


Mime
View raw message