https://bugzilla.novell.com/show_bug.cgi?id=340501
Summary: Problem with specifying a custom port for SmtpSend Product: Mono: Class Libraries Version: 1.2 Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Sys.Web AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] QAContact: [EMAIL PROTECTED] Found By: --- In MS.NET 1.1 the way to specify a custom port (other than 25) for SmtpSend is to add a field to the message like this : message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport",8000); (for port 8000) This test case works well in MS.NET : Console.WriteLine("envoie "+i); MailMessage message=new MailMessage(); message.Subject="Essai"; message.From="[EMAIL PROTECTED]"; message.To="[EMAIL PROTECTED]"; message.Body="essai"; message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport",8000); SmtpMail.SmtpServer="10.69.100.164"; SmtpMail.Send(message); In MS.NET it works well, in mono (svn) it fails with : Unhandled Exception: System.Web.HttpException: Connection refused ---> System.Net.Sockets.SocketException: Connection refused So it seems that mono tries to connect to the 25 port. All the code is in mono to handle this, but there's a little mistake... The TCPConnection is etablished before setting the port... Here's the patch that correct the problem : Index: class/System.Web/System.Web.Mail/SmtpClient.cs =================================================================== --- class/System.Web/System.Web.Mail/SmtpClient.cs (révision 89301) +++ class/System.Web/System.Web.Mail/SmtpClient.cs (copie de travail) @@ -54,7 +54,6 @@ public SmtpClient( string server ) { this.server = server; - Connect(); } // make the actual connection @@ -117,7 +116,7 @@ private void StartSend(MailMessageWrapper msg) { ReadFields(msg); - + Connect(); // read the server greeting smtp.ReadResponse(); smtp.CheckForStatusCode( 220 ); Please commit and backport to 1.2.6... Thanks -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. _______________________________________________ mono-bugs maillist - mono-bugs@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-bugs