[Mono-bugs] [Bug 81817][Wis] New - System.Net.Mail.MailMessage.To is NULL when default constructor is used.

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Jun 6 14:20:11 EDT 2007

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 simon_adams at affymetrix.com.


--- shadow/81817	2007-06-06 14:20:11.000000000 -0400
+++ shadow/81817.tmp.32532	2007-06-06 14:20:11.000000000 -0400
@@ -0,0 +1,40 @@
+Bug#: 81817
+Product: Mono: Runtime
+Version: 1.1
+OS: unknown
+OS Details: fedora-core-6-x86_64
+Status: NEW   
+Priority: Wishlist
+Component: misc
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: simon_adams at affymetrix.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: System.Net.Mail.MailMessage.To is NULL when default constructor is used.
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+MailMessage.To is null if the default constructor is used.
+Steps to reproduce the problem:
+1. Construct a new instance of MailMessage
+2. Attempt to use MailMessage.To.Add()
+Actual Results:
+Will throw a System.NullReferenceException because .To is null.
+Expected Results:
+The mail address will be added to the to list.
+How often does this happen? 
+Every time.
+Additional Information:
+The workaround is to use the MailMessage constructor with the From and To
+lists parameters.

More information about the mono-bugs mailing list