2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / class / System.Web / System.Web.Mail / MailMessage.cs
index 503e0842133054d523b3425b00453f706ab76f57..cd0eb98f335acffd35fc1271e0376bbb180f0328 100644 (file)
@@ -4,7 +4,31 @@
 // Author:\r
 //    Lawrence Pit (loz@cable.a2000.nl)\r
 //    Per Arneng (pt99par@student.bth.se)\r
+//     Sanjay Gupta (gsanjay@novell.com)
+//
+//     (c)2004 Novell, Inc. (http://www.novell.com)
 //\r
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
 \r
 using System;\r
 using System.Collections;\r
@@ -19,24 +43,30 @@ namespace System.Web.Mail
        {\r
                private ArrayList attachments;\r
                private string bcc;\r
-               private string body;\r
+               private string body = "";\r
                private Encoding bodyEncoding;\r
                private MailFormat bodyFormat;\r
                private string cc;              \r
                private string from;\r
                private ListDictionary headers;\r
                private MailPriority priority;\r
-               private string subject;\r
+               private string subject = "";\r
                private string to;\r
                private string urlContentBase;\r
-               private string urlContentLocation;\r
+               private string urlContentLocation;
                \r
                // Constructor          \r
                public MailMessage ()\r
                {\r
                        attachments = new ArrayList (8);\r
                        headers = new ListDictionary ();\r
-                       bodyEncoding = Encoding.Default;\r
+                       bodyEncoding = Encoding.Default;
+#if NET_1_1
+                       fields = new Hashtable ();\r
+#endif
+#if NET_2_0
+                       bodyParts = new ArrayList (2);
+#endif
                }               \r
        \r
                // Properties\r
@@ -104,11 +134,23 @@ namespace System.Web.Mail
                }\r
 \r
 #if NET_1_1\r
-               [MonoTODO]\r
+               private Hashtable fields;\r
+               
                public IDictionary Fields {\r
-                       get { throw new NotImplementedException (); }\r
+                       get {
+                               return (IDictionary) fields;
+                       }\r
                }\r
 #endif\r
+
+#if NET_2_0
+               private ArrayList bodyParts;
+               
+               public IList RelatedBodyParts {
+                       get { return (IList) bodyParts; }
+               }
+#endif
+
        }\r
        \r
 } //namespace System.Web.Mail\r