asp.net1.1 threading problem

  • Thread starter Thread starter tasleem
  • Start date Start date
T

tasleem

Hi!

I am using thread to send multiple/bulk email. But my thread is not calling
the me method that send emails.
I work well on localhost. But when i upload it on server it didn't call the
method (sendNewsletter_1).
I am using following code
public static bool sendBulkEmail_1(int newsletterID)
{
m_newsletterID = newsletterID;
Thread threadMail = new Thread(new ThreadStart(sendNewsletter_1));
threadMail.IsBackground = true;
threadMail.Start();
Thread.Sleep(2000);
return true;
}
public static void sendNewsletter_1()
{
Log_1("SendNewsLetter"); //just write this test string to a file. Its just
or testing.
}
 
Are you sure that perhaps it *is* calling it, but IIS (quite
reasonably) isn't allowing access to the file system?

This might be better aimed as an ASP.NET group

Marc
 
no there is no Access issue, log function is called from thread creating
function
but and it is logged i mean values are written. so no access issue.
anything else or any other suggestion, to do such thing.
 
If you are going to send multiple emails like this, I suggest you use the
ThreadPool class via its QueueUserWorkItem method, and handle the email
sending in the asynchronous callback method. Much more efficient. You should
not need to sleep the thread for 2 seconds, I don't see where that
accomplishes anything other than to add an extra 2 seconds of time to every
call.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com
 
Back
Top