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