It sends only one MailMessage message from the connection. In fact, it does not even close the connection. He sends mail, but then he does not inform the mail server that he wants to exit. That way, it just leaves it open until the main thread pool decides to close the socket.
Here is the internal code from Reflector:
...
this.GetConnection();
fileMailWriter = this.transport.SendMail((message.Sender != null) ? message.Sender : message.From, recipients, message.BuildDeliveryStatusNotificationString(), out exception);
}
catch (Exception exception2)
{
if (Logging.On)
{
Logging.Exception(Logging.Web, this, "Send", exception2);
}
if ((exception2 is SmtpFailedRecipientException) && !((SmtpFailedRecipientException) exception2).fatal)
{
throw;
}
this.Abort();
if (this.timedOut)
{
throw new SmtpException(SR.GetString("net_timeout"));
}
if (((exception2 is SecurityException) || (exception2 is AuthenticationException)) || (exception2 is SmtpException))
{
throw;
}
throw new SmtpException(SR.GetString("SmtpSendMailFailure"), exception2);
}
btw, here is more information about SmtpClient not issuing a QUIT command.
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=146711&wa=wsignin1.0
Edit: view the dead link above at web.archive.org
, SmtpClient.ServicePoint.MaxTimeout 1. , QUIT.