The .NET class System.Net.Mail.SmtpClient does not issue a QUIT command for an SMTP transaction

Has anyone had a problem with this? If so, how do you get around this? We get sporadic timeout problems, and it is blamed.

It also reports the same issue:

http://www.vbforums.com/showthread.php?p=3609268

+4
source share
4 answers

I don’t know if there is an easier way to get around this particular problem, but one option would be to download the source for Mono SmtpClient and use it (changing if necessary). Their version definitely sends the QUIT command.

, , . .NET , SMTP. Mono , QUIT . 25 Mono, ( , copy + paste edit namespace).

, , : , , API SmtpClient's.

+10

IIS? , SMTP, SMTP- :

var client = new SmtpClient 
{ 
    DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis 
};

, .

+4

.Net 4. IDispose, QUIT .

MSDN:

SmtpClient Finalize , . Dispose SMTP- Host QUIT, TCP-. Dispose , Socket , , .

Call Dispose when you are done using SmtpClient. Dispose of the method leaves SmtpClient in an unusable state. After calling Dispose, you should free all references to SmtpClient, so the garbage collector can return the memory that SmtpClient occupied.

+4
source

It looks like I'm going to find a third-party product to fix this problem. The mono solution sounds interesting, but I would rather spend a few dollars and get a commercial solution.

0
source

All Articles