Here is my code:
SmtpClient client = new SmtpClient();
client.UseDefaultCredentials = true;
using (client as IDisposable)
{
foreach (MailAddress addr in Addresses)
{
if (addr != null)
{
try
{
message.To.Clear();
message.To.Add(addr);
client.Send(message);
}
catch (Exception ex)
{
Log(ex);
}
i++;
}
}
}
every 100 seconds, I log a message saying
The operation has timed out.
Is this a client side setting or on the actual mail server?
The problem happens when you are not able to connect to SMTP server and thats why this timeout message occur. So this message occurs on your client when your client is not able to connect to your SMTP Server:
100 second is default value as described below:
http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.timeout.aspx
There could be several issue why this prblem could occur i.e. Wrong SMTP address, SMTP reject, Port setting, SSL configuration etc which you need to fix.