Sending lots of mails using SmtpClient (C#) takes very long after a while

Posted by Lieven Cardoen on Server Fault See other posts from Server Fault or by Lieven Cardoen
Published on 2010-04-18T12:24:58Z Indexed on 2010/04/18 12:33 UTC
Read the original article Hit count: 383

Filed under:
|
|

I'm using this piece of code to send a mail:

SmtpClient client = new SmtpClient();
client.Host = smtpServer;
client.Send(mailMessage);

If I trigger this code ten times/second, then after some hundred mails, sending a mail takes 10 seconds... Could there be a queue involved here?

© Server Fault or respective owner

Sending lots of mails using SmtpClient (C#) takes very long after a while

Posted by Lieven Cardoen on Stack Overflow See other posts from Stack Overflow or by Lieven Cardoen
Published on 2010-04-18T12:24:28Z Indexed on 2010/04/18 12:33 UTC
Read the original article Hit count: 383

Filed under:
|
|

I'm using this piece of code to send a mail:

SmtpClient client = new SmtpClient();
client.Host = smtpServer;
client.Send(mailMessage);

If I trigger this code ten times/second, then after some hundred mails, sending a mail takes 10 seconds... Could there be a queue involved here?

  • Shouldn't this be asynchronous?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET