Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

While testing to send multiple emails, I successfully sent about 100 emails (with a 20KB pdf attachment), to the same email-address (my own), and they were all received. But on next attempt, my cPanel account was blocked, due to a "brute force attempt".

Are there any special precautions I need to take when sending bulk emails? I simply looped through below code without pause for each email. What type of alert could that give on the email server, and how should I avoid it?

  client = New SmtpClient(smtp, Convert.ToInt32(port))
  AddHandler client.SendCompleted, AddressOf OnAsyncSendComplete
  client.Credentials = New System.Net.NetworkCredential(usn, psw)
  client.SendAsync(mail, token) 

Should I wait for SendComplete event for each email before sending the next?

share|improve this question

migrated from Nov 13 '11 at 11:21

This question came from our site for professional and enthusiast programmers.

closed as off topic by Shane Madden, Ward, Iain, mailq, voretaq7 Nov 21 '11 at 14:47

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

This is rather a system administration question regarding anti-spamming policies of your hosting provider and not a programming question. – Ondrej Tucny Nov 13 '11 at 11:01
@Ondrej, Ok, I thought perhaps there could be queuing practices that apply to code design. But otherwise, on what site should I ask this question? – bretddog Nov 13 '11 at 11:05
You should ask your hosting provider what the problem is. Otherwise we're guessing rather blindly. – Bill Weiss Nov 13 '11 at 15:22
@mailq moved as requested with my solution for web server SMTP limitations. – Fiasco Labs Nov 13 '11 at 18:15

Your hosting provider has limits on the amount of email that can be sent per hour. Reading the TOS before signing up for a service is important. Most website hosting services have had enough with being blocked for being spam sources. You exceeded that limit and need to (after the fact) find out how much email you are allowed to send. They'd rather let iConnect, MailChimp, et. al. regulate the sending of bulk mail.

On our web server (100 emails/hour unless you provide proof of a working opt-in mail request with email verification of sign-up and user unsubscribe), I push the web server SMTP traffic over to Rackspace (athenticated and secure for proven origin) who has a bit different TOS. No more than 250 identical emails per hour, ie run your business with as much email as you want, the machine generated stuff like sales orders and customer order responses will all be different, but if you decide to send out the company newsletter, well it'd better be a small list, will take some time, let someone else do it if you want 10,000 emails to go in a day.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.