Saturday, April 27, 2013

Email not sent until application closes in C#

Email not sent until application closes in C#

It may happen that your email via SMTP will not get sent until the application closes in C#.net

To send the email immediately and at the same time the application is working, you can include the below mentioned line of code:

System.Net.ServicePointManager.MaxServicePointIdleTime = 1

No comments:

Post a Comment