Long time reader, first-time asker.
I get a time-out when sending email to 110 BCC recipients.
I'm trying to send a single email message from a website to members of my club whose website I run. I add myself as the sender and receiver, and the members' email addresses go in the BCC list. There are about 110 members. I authenticate against the server with the sender's username and password.
I can prepare the MailMessage just fine, but when I call SmtpClient.Send() it times-out, even with a threshold of 10 minutes. When there are fewer recipients, the Send() method still takes ages (5-7 minutes) but completes successfully. This happens regardless of the size of the message or attachments, even with no attachments.
I think that my mail server (on my hosted web server) is somehow checking each recipient email address against an external system such as a spam/blacklist or against each recipient mail server.
My hosting company is stumped, they swear blind that it's all OK.
Do you know of a member on StmpClient or MailMessage that I can set to tell the mail server not to do this? Or perhaps (even better) as setting in the Parallels HSPhere email server to stop this action?
Many thanks in advance.
Sample code
bool SendEmail(string[] emailAddresses)
{
MailMessage message = new MailMessage();
SmtpClient smtp = new SmtpClient("mail.myServer.org");
message.From = new MailAddress("website@myServer.org", "Display name");
message.To.Add("website@myServer.org");
foreach (string recipient in emailAddresses)
{
// ABout 110 recipients
message.Bcc.Add(recipient);
}
message.Subject = "Whatever";
message.ReplyTo = new MailAddress("myOtherEmailAddress@external.com");
smtp.Credentials = new NetworkCredential(message.From.Address, "whatever");
try
{
message.Body = "A few hundred bytes";
smtp.Timeout = 300000; // 10 mins
smtp.Send(message);
}
catch (Exception ex)
{
// Report here
}
return true;
}