From d0974b83f550e3357ebda043c5b30873f53908e7 Mon Sep 17 00:00:00 2001 From: Miha Zupan Date: Wed, 27 Nov 2019 15:09:38 +0100 Subject: [PATCH] Fix SmtpClient handling exceptions as timeouts (#288) 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 d67a2660eda60..01bb0a44e7355 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 ||