Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mcs/class/System/System.Net.Mail/MailMessage.cs')
-rw-r--r--mcs/class/System/System.Net.Mail/MailMessage.cs36
1 files changed, 9 insertions, 27 deletions
diff --git a/mcs/class/System/System.Net.Mail/MailMessage.cs b/mcs/class/System/System.Net.Mail/MailMessage.cs
index c45ac4e9283..702940250c3 100644
--- a/mcs/class/System/System.Net.Mail/MailMessage.cs
+++ b/mcs/class/System/System.Net.Mail/MailMessage.cs
@@ -31,7 +31,6 @@
#if NET_2_0
using System.Collections.Specialized;
-using System.Globalization;
using System.Net.Mime;
using System.Text;
@@ -45,16 +44,17 @@ namespace System.Net.Mail {
AttachmentCollection attachments;
MailAddressCollection bcc;
string body;
+ bool isBodyHtml;
MailPriority priority;
MailAddress replyTo, sender;
DeliveryNotificationOptions deliveryNotificationOptions;
+ Encoding bodyEncoding;
MailAddressCollection cc;
MailAddress from;
NameValueCollection headers;
MailAddressCollection to;
string subject;
Encoding subjectEncoding;
- ContentType bodyContentType;
#endregion // Fields
@@ -64,12 +64,8 @@ namespace System.Net.Mail {
{
}
- [MonoTODO ("FormatException")]
public MailMessage (MailAddress from, MailAddress to)
{
- if (from == null || to == null)
- throw new ArgumentNullException ();
-
From = from;
this.to = new MailAddressCollection ();
@@ -87,15 +83,11 @@ namespace System.Net.Mail {
public MailMessage (string from, string to)
: this (new MailAddress (from), new MailAddress (to))
{
- if (from == null || to == null)
- throw new ArgumentNullException ();
}
public MailMessage (string from, string to, string subject, string body)
: this (new MailAddress (from), new MailAddress (to))
{
- if (from == null || to == null)
- throw new ArgumentNullException ();
Body = body;
Subject = subject;
}
@@ -121,17 +113,12 @@ namespace System.Net.Mail {
set { body = value; }
}
- internal ContentType BodyContentType {
- get {
- if (bodyContentType == null)
- bodyContentType = new ContentType ("text/plain; charset=us-ascii");
- return bodyContentType;
- }
- }
-
public Encoding BodyEncoding {
- get { return Encoding.GetEncoding (BodyContentType.CharSet); }
- set { BodyContentType.CharSet = value.WebName; }
+ get { return bodyEncoding; }
+ set {
+ bodyEncoding = value;
+ //bodyContentType.CharSet = value.WebName;
+ }
}
public MailAddressCollection CC {
@@ -153,13 +140,8 @@ namespace System.Net.Mail {
}
public bool IsBodyHtml {
- get { return String.Compare (BodyContentType.MediaType, "text/html", true, CultureInfo.InvariantCulture) == 0; }
- set {
- if (value)
- BodyContentType.MediaType = "text/html";
- else
- BodyContentType.MediaType = "text/plain";
- }
+ get { return isBodyHtml; }
+ set { isBodyHtml = value; }
}
public MailPriority Priority {