How do I avoid a delay when sending email from my application?

前端 未结 6 915
深忆病人
深忆病人 2021-01-26 03:23

I have a small console application. It checks a few settings, makes some decisions, and sends an email. The problem is the email doesn\'t actually get sent until my application

6条回答
  •  佛祖请我去吃肉
    2021-01-26 04:20

    Use SmtpClient with setting:

    smtpClient.ServicePoint.MaxIdleTime = 2;
    

    https://weblogs.asp.net/stanleygu/tip-14-solve-smtpclient-issues-of-delayed-email-and-high-cpu-usage

提交回复
热议问题