0

I'm sending bulk mail from an asp.net application but after sending 80 emails the thread is killed by the system. Anyone knows a way to keep the thread alive until it finishes? I saw that there are ways to multi-threading and background processing but I need a quick working solution. Something to tell the system to mind its own business until I have the time to re-do the sending function.

I tried to change the tag <httpRuntime executionTimeout="300"/> in web.config but doesn't help.

halfer
  • 19,824
  • 17
  • 99
  • 186
  • Do you have a queue system available to you? Threads are lightweight devices, sending emails sounds like a heavyweight thing you'd have a whole process for. – halfer Sep 13 '18 at 19:41
  • Heavyness is not the problem, time is. I need to send up to 2000 emails at a time, so it tooks a while and after 70-80 emails the thread is killed because the system thinks that the process is hanging – Gabriele Cozzolino Sep 14 '18 at 05:54
  • Doesn't that support my view that you should not be using a thread for this? I don't use Windows, but it still sounds more appropriate for a separate process. I wonder whether you might be blacklisted for sending mail that quickly anyway - the paradox of scaling SMTP sending is that is needs to be done more slowly, not more quickly. – halfer Sep 14 '18 at 21:09

0 Answers0