You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by dl...@apache.org on 2001/07/27 19:17:03 UTC

cvs commit: jakarta-turbine/src/adapter/org/apache/turbine/util/mail Email.java

dlr         01/07/27 10:17:03

  Modified:    src/adapter/org/apache/turbine/util/mail Email.java
  Log:
  Applied patch by Colin Chalmers <co...@maxware.nl>:
  
  1. Corrected the " Disposition-Notification-To: user@domain.net" example
  identified yesterday.
  2. There was a global session that was not being used.
  3. Changed the setting of debug info for the correct session and not the
  global which was therafter redundant.
  
  Revision  Changes    Path
  1.4       +12 -8     jakarta-turbine/src/adapter/org/apache/turbine/util/mail/Email.java
  
  Index: Email.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine/src/adapter/org/apache/turbine/util/mail/Email.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -u -r1.3 -r1.4
  --- Email.java	2001/07/25 01:05:29	1.3
  +++ Email.java	2001/07/27 17:17:03	1.4
  @@ -83,7 +83,7 @@
    * @author <a href="mailto:greg@shwoop.com">Greg Ritter</a>
    * @author <a href="mailto:unknown">Regis Koenig</a>
    * @author <a href="mailto:colin.chalmers@maxware.nl">Colin Chalmers</a>
  - * @version $Id: Email.java,v 1.3 2001/07/25 01:05:29 jvanzyl Exp $
  + * @version $Id: Email.java,v 1.4 2001/07/27 17:17:03 dlr Exp $
    */
   public abstract class Email
   {
  @@ -112,9 +112,6 @@
       /** The email message to send. */
       protected MimeMessage message = null;
   
  -    /** The Session class represents a mail session */
  -    private Session session = null;
  -
       /** The charset to use for this message */
       protected String charset = null;
   
  @@ -132,6 +129,9 @@
   
       /** The content type  */
       private String contentType = null;
  +    
  +    /** Set session debugging on or off*/
  +    private boolean debug = false;
   
      /**
       * The hostname of the mail server with which to connect. If null will try to get
  @@ -150,7 +150,7 @@
        *
        * X-Mailer: Sendmail, X-Priority: 1(highest)
        * or  2(high) 3(normal) 4(low) and 5(lowest)
  -     * Disposition-Notification-To: returnR user@domain.net
  +     * Disposition-Notification-To: user@domain.net
        */
       private Hashtable headers = null;
   
  @@ -161,7 +161,7 @@
        */
       public void setDebug(boolean d)
       {
  -        session.setDebug(d);
  +        this.debug = d;
       }
   
       /**
  @@ -229,8 +229,12 @@
           }
           
           properties.setProperty(MAIL_HOST, hostName);
  +        
  +        Session session = Session.getDefaultInstance(properties, null);
  +        
  +        session.setDebug(this.debug);
           
  -        return Session.getDefaultInstance(properties, null);
  +        return session;
       }
   
       /**
  @@ -438,7 +442,7 @@
        *
        * X-Mailer: Sendmail, X-Priority: 1(highest)
        * or  2(high) 3(normal) 4(low) and 5(lowest)
  -     * Disposition-Notification-To: returnR user@domain.net
  +     * Disposition-Notification-To: user@domain.net
        *
        * @param h A Hashtable.
        */
  
  
  

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