ChangeLog: Updated ChangeLog.
[mono.git] / mcs / class / System.Web / System.Web.Mail / MailMessage.cs
1 //\r
2 // System.Web.Mail.MailMessage.cs\r
3 //\r
4 // Author:\r
5 //    Lawrence Pit (loz@cable.a2000.nl)\r
6 //    Per Arneng (pt99par@student.bth.se)\r
7 //      Sanjay Gupta (gsanjay@novell.com)
8 //
9 //     (c)2004 Novell, Inc. (http://www.novell.com)
10 //\r
11
12 //
13 // Permission is hereby granted, free of charge, to any person obtaining
14 // a copy of this software and associated documentation files (the
15 // "Software"), to deal in the Software without restriction, including
16 // without limitation the rights to use, copy, modify, merge, publish,
17 // distribute, sublicense, and/or sell copies of the Software, and to
18 // permit persons to whom the Software is furnished to do so, subject to
19 // the following conditions:
20 // 
21 // The above copyright notice and this permission notice shall be
22 // included in all copies or substantial portions of the Software.
23 // 
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
29 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 //
32 \r
33 using System;\r
34 using System.Collections;\r
35 using System.Collections.Specialized;\r
36 using System.Text;\r
37 \r
38 namespace System.Web.Mail\r
39 {\r
40         /// <remarks>\r
41         /// </remarks>\r
42         public class MailMessage\r
43         {\r
44                 private ArrayList attachments;\r
45                 private string bcc;\r
46                 private string body = "";\r
47                 private Encoding bodyEncoding;\r
48                 private MailFormat bodyFormat;\r
49                 private string cc;              \r
50                 private string from;\r
51                 private ListDictionary headers;\r
52                 private MailPriority priority;\r
53                 private string subject = "";\r
54                 private string to;\r
55                 private string urlContentBase;\r
56                 private string urlContentLocation;
57                 \r
58                 // Constructor          \r
59                 public MailMessage ()\r
60                 {\r
61                         attachments = new ArrayList (8);\r
62                         headers = new ListDictionary ();\r
63                         bodyEncoding = Encoding.Default;
64 #if NET_1_1
65                         fields = new Hashtable ();\r
66 #endif
67 #if NET_2_0
68                         bodyParts = new ArrayList (2);
69 #endif
70                 }               \r
71         \r
72                 // Properties\r
73                 public IList Attachments {\r
74                         get { return (IList) attachments; }\r
75                 }               \r
76                 \r
77                 public string Bcc {\r
78                         get { return bcc; } \r
79                         set { bcc = value; }\r
80                 }\r
81         \r
82                 public string Body {\r
83                         get { return body; } \r
84                         set { body = value; }\r
85                 }\r
86 \r
87                 public Encoding BodyEncoding {\r
88                         get { return bodyEncoding; } \r
89                         set { bodyEncoding = value; }\r
90                 }\r
91 \r
92                 public MailFormat BodyFormat {\r
93                         get { return bodyFormat; } \r
94                         set { bodyFormat = value; }\r
95                 }               \r
96 \r
97                 public string Cc {\r
98                         get { return cc; } \r
99                         set { cc = value; }\r
100                 }\r
101 \r
102                 public string From {\r
103                         get { return from; } \r
104                         set { from = value; }\r
105                 }\r
106 \r
107                 public IDictionary Headers {\r
108                         get { return (IDictionary) headers; }\r
109                 }\r
110                 \r
111                 public MailPriority Priority {\r
112                         get { return priority; } \r
113                         set { priority = value; }\r
114                 }\r
115                 \r
116                 public string Subject {\r
117                         get { return subject; } \r
118                         set { subject = value; }\r
119                 }\r
120 \r
121                 public string To {\r
122                         get { return to; }   \r
123                         set { to = value; }\r
124                 }\r
125 \r
126                 public string UrlContentBase {\r
127                         get { return urlContentBase; } \r
128                         set { urlContentBase = value; }\r
129                 }\r
130 \r
131                 public string UrlContentLocation {\r
132                         get { return urlContentLocation; } \r
133                         set { urlContentLocation = value; }\r
134                 }\r
135 \r
136 #if NET_1_1\r
137                 private Hashtable fields;\r
138                 
139                 public IDictionary Fields {\r
140                         get {
141                                 return (IDictionary) fields;
142                         }\r
143                 }\r
144 #endif\r
145
146 #if NET_2_0
147                 private ArrayList bodyParts;
148                 
149                 public IList RelatedBodyParts {
150                         get { return (IList) bodyParts; }
151                 }
152 #endif
153
154         }\r
155         \r
156 } //namespace System.Web.Mail\r