Please apply the attached patch. It corrects the following problems:

1) toString() failed in JDK 1.3 because the method StringBuffer.append(StringBuffer) does not exist. The method was added in JDK 1.4.

2) Empty subjects are in the message. Now the subject will only be includes when it is non-null.

Thank you,
Paul Spencer
Index: SimpleSMTPHeader.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-commons/net/src/java/org/apache/commons/net/smtp/SimpleSMTPHeader.java,v
retrieving revision 1.3
diff -u -r1.3 SimpleSMTPHeader.java
--- SimpleSMTPHeader.java       26 Jan 2003 00:21:45 -0000      1.3
+++ SimpleSMTPHeader.java       14 Jul 2003 15:52:44 -0000
@@ -149,7 +149,8 @@
     /***
      * Converts the SimpleSMTPHeader to a properly formatted header in
      * the form of a String, including the blank line used to separate
-     * the header from the article body.
+     * the header from the article body.  The header fields CC and Subject
+     * are only included when they are non-null.
      * <p>
      * @return The message header in the form of a String.
      ***/
@@ -168,13 +169,16 @@
         if (__cc != null)
         {
             header.append("\nCc: ");
-            header.append(__cc);
+            header.append(__cc.toString());
         }
 
-        header.append("\nSubject: ");
-        header.append(__subject);
-        header.append('\n');
+        if (__subject != null)
+        {
+            header.append("\nSubject: ");
+            header.append(__subject);
+        }
 
+        header.append('\n');
         header.append('\n');
 
         return header.toString();

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to