Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jul 29, 2012 10:11 AM by dahla
Jul 29, 2012 09:43 AM|LINK
I want to send bulk emails from database. I used threading as following
Thread t = new Thread(SendToRegisteredUsers);
t.Priority = ThreadPriority.BelowNormal;
foreach (string email in EmailList)
if (email != null)
It only sends 5 emails, then i dont know where the above thread goes. i have more than 3000 emails.
Please suggest some better code or techique.
Jul 29, 2012 09:48 AM|LINK
1) please check whether EmailList contains all the email ids
2) most of the hosting providers have a restriction to send out a limited amout of emails per hour many provides 100 per hour etc.
so please check with hosting provider how much is the limit
Jul 29, 2012 09:49 AM|LINK
If it throws an exception then your entire thread is stopped. I.e. email is an invalid email so the SendEmailViaHostingServer method fails...
Try debugging your way into it
Jul 29, 2012 10:00 AM|LINK
How i can debug in a thread, you mean F10. That i already did. I am sure there will be some invalid emails.
Jul 29, 2012 10:11 AM|LINK
I just missed the fact that you posted this in the asp.net section.
But first of all you need to catch any exceptions because on the first encountered exception the thread dies and will not continue or give any notice.
But you can debug it by attaching to the webprocess and then adding a breakpoint. Or pressing F5 depending on how you websolution is setup