यह केवल कनेक्शन से एक मेल मेल भेजता है। वास्तव में, यह कनेक्शन को ठीक से बंद भी नहीं करता है। यह मेल भेजता है, लेकिन फिर यह मेल सर्वर को नहीं बताता है कि वह छोड़ना चाहता है। इसलिए, यह केवल खुले लटकने को छोड़ देता है, जब तक अंतर्निहित पूल स्ट्रीम सॉकेट को बंद करने का फैसला नहीं करती है।
...
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, अधिक जानकारी SmtpClient जारी करने के आदेश QUIT नहीं के बारे में है:
यहाँ परावर्तक से आंतरिक कोड है। https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=146711&wa=wsignin1.0
संपादित करें: web.archive.org
पर मृत ऊपर दिया गया लिंक देखें काम के आसपास 1. इस के लिए SmtpClient.ServicePoint.MaxTimeout स्थापित करने के लिए तेजी से सॉकेट बंद हो जाएगा है, तथापि, यह वास्तव में जारी नहीं करता है QUIT कमांड।
स्रोत
2009-06-09 12:41:51
क्या 'QUIT' के साथ समस्या को नए .NET ढांचे में तय किया गया है? – jocull
यह माना जाता है कि .NET 4.0 https://stackoverflow.com/questions/1466572/net-system-net-mail-smtpclient-class-doesnt-issue-quit-command-to-smtp-transac?noredirect=1 में तय किया गया था # comment79406662_1466572 – jocull