[Mono-bugs] [Bug 80584][Nor] New - [2.0] SmtpClient always uses authentication

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Jan 23 03:38:21 EST 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 gert.driesen at pandora.be.

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

--- shadow/80584	2007-01-23 03:38:20.000000000 -0500
+++ shadow/80584.tmp.25566	2007-01-23 03:38:20.000000000 -0500
@@ -0,0 +1,46 @@
+Bug#: 80584
+Product: Mono: Class Libraries
+Version: 1.2
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: gert.driesen at pandora.be               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: [2.0] SmtpClient always uses authentication
+
+In the ctor of SmtpClient, ConfigurationManager.GetSection is used to get 
+the smtp configuration section, and initialize credentials (and host, ...) 
+from values in the configuration file.
+
+However, ConfigurationManager.GetSection always returns an initialized 
+SmtpSection with properties initialized to their default values.
+
+As a result, the SmtpClient has credentials set and always uses 
+authentication to connect to the SMTP server.
+
+To resolve this we need to be able to determine whether there is indeed an 
+smtp section in the configuration file, and if there is, obtain an 
+SmtpSection with no default values set.
+
+To reproduce, compile and run the following code snippet replacing the 
+host and email addresses with valeus specific to your setup:
+
+using System.Net.Mail;
+
+public class Test
+{
+  static void Main ()
+  {
+    SmtpClient smtp = new SmtpClient ("<smtp host>");
+    smtp.Send ("no-reply at somewhere.com", "<recipient>",
+			"SUBJECT", "OK");
+  }
+}


More information about the mono-bugs mailing list