From 61cf6e1316a9314b8ffbc92f3ef00bfdf483160e Mon Sep 17 00:00:00 2001 From: Miha Zupan Date: Mon, 25 Nov 2019 10:24:23 +0100 Subject: [PATCH] Fix SmtpClient handling exceptions as timeouts Only non-async calls on SmtpClient can timeout. As the flag is not reset in the async path, it could already be set and SmtpClient would propagate any exception in the async path as a timeout --- .../System.Net.Mail/src/System/Net/Mail/SmtpClient.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpClient.cs b/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpClient.cs index d67a2660eda608..01bb0a44e73558 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpClient.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpClient.cs @@ -721,10 +721,6 @@ public void SendAsync(MailMessage message, object userToken) } Abort(); - if (_timedOut) - { - throw new SmtpException(SR.net_timeout); - } if (e is SecurityException || e is AuthenticationException ||