[Mono-bugs] [Bug 54908][Wis] New - patch for System.Web.Mail.MailMessage for empty body or subject

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 26 Feb 2004 14:40:26 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by jluke@cfl.rr.com.

http://bugzilla.ximian.com/show_bug.cgi?id=54908

--- shadow/54908	2004-02-26 14:40:26.000000000 -0500
+++ shadow/54908.tmp.26963	2004-02-26 14:40:26.000000000 -0500
@@ -0,0 +1,48 @@
+Bug#: 54908
+Product: Mono/Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Sys.Web
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: jluke@cfl.rr.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: patch for System.Web.Mail.MailMessage for empty body or subject
+
+MailMessage does not initialize its fields when created, so the following
+fails with mono cvs, but works on MS:
+
+using System;
+using System.Web.Mail;
+
+class MainClass
+{    
+	public static void Main (string[] args)    
+	{        
+		MailMessage email = new MailMessage ();        
+		email.To = "someone@somewhere";        
+		email.From = "someone@somewhere";               
+
+		Console.WriteLine (email.Fields); // hashtable        
+		Console.WriteLine (email.Fields.Count); //0
+        Console.WriteLine (email.Fields.IsFixedSize); //false        
+		Console.WriteLine (email.Fields.IsReadOnly); //false        
+		Console.WriteLine (email.Fields.IsSynchronized); //false        
+		Console.WriteLine (email.Fields.Keys.Count); //0        
+		Console.WriteLine (email.Fields.Values.Count); //0  
+
+		SmtpMail.SmtpServer = "some.smtpserver";
+		SmtpMail.Send (email);  
+	}
+}
+
+Note: this is actually two things, the Body and Subject are not initialized
+to "" and there is a MonoTodo for the .NET 1.1 Fields property.  (Sorry for
+attaching them in the same bug report and patch)