SMTP Timeout Error with C# code in SharePoint
Recently we have come across with SMTP timeout issue in all SharePoint applications. Due to this Workflows became error occurred and Timer jobs got failed. You know workflows are very critical to business and also if background operations does not complete at specific time it may become critical to business. Then we have implemented following quick fix.
SmtpClient client=new SmtpClient();
client.Host = smtpserver;
client.ServicePoint.MaxIdleTime = 0;
client.ServicePoint.ConnectionLimit = 1;
client.Timeout = 10000000;
client.Send(newEmail);
Alternatively we can also use asynchronous option as specified in the below blog.
http://www.codeproject.com/Articles/667461/Send-asynchronous-mail-using-asp-net
SmtpClient client=new SmtpClient();
client.Host = smtpserver;
client.ServicePoint.MaxIdleTime = 0;
client.ServicePoint.ConnectionLimit = 1;
client.Timeout = 10000000;
client.Send(newEmail);
Alternatively we can also use asynchronous option as specified in the below blog.
http://www.codeproject.com/Articles/667461/Send-asynchronous-mail-using-asp-net
Comments
Post a Comment