Click here to Skip to main content
15,893,663 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
I want efficient way, like more than 200 mails/seconds. How can maximum number of threads we can create and Is there any much better approach to do that?
Posted
Comments
Richard MacCutchan 14-Apr-15 5:30am    
The only people who would need to do such a thing are spammers.
Member 10184740 14-Apr-15 9:13am    
Dont worry. Not gonna use that for spamming or something else. Just need to design a system like that for some project.!
Richard MacCutchan 14-Apr-15 10:53am    
Why do you need to send 200/second? You can send emails at any speed since they will not be delivered instantaneously. And even if your application could run that fast, the SMTP server will probably not be able to handle that much traffic.

1 solution

There is no efficiency in bulk data, you have to be patient in this scenario.

Now let me give you an answer. If you can (somehow) manage to get 200 threads on your CPU and allow each of this thread to send an email to your client. You still won't be able to, until you are having an SMTP server and the network strong enough to,


  1. Send the data to SMTP server.
  2. Process the request and send the email.
  3. Return the response; most probably "Ok".


... All in just one second. Only then you can expect your Bulk email sending program to send 200 emails in one second.

If you cannot perform this... Then the only thing left is patience. I did answer similar questions before, and I gave the same solution. Emails (and all other type of network related resources and data) do not only depend on your threads, CPU, code efficiency. They depend on the network speed and the SMTP server response. If you get able to create the (above mentioned) program but your SMTP is not fast and strong enough, you will still not get to the desired results. Sending bulk emails really requires a lot of patience (on both sides; client and sender).

Personal experience...

200 emails/seconds is not accessible; also you should never pay a fortune cookie for spam Whoops, bulk emails. I remember day before yesterday I was teaching my brother how to write applications in C# and the topic was Sending emails. We created a Windows Forms application and when we sent (only one) email; we were using Dual Core CPU, 4 MB internet connection, the response sent by the SMTP server (Gmail) was received after 4 seconds.
 
Share this answer
 
Comments
Member 10184740 14-Apr-15 9:04am    
Thanks Afzaal but i want to use java thread for sending mails to customer more then thousands mail at a time
Afzaal Ahmad Zeeshan 14-Apr-15 9:38am    
Sending the emails is not trouble. The trouble is time that will be taken to send the emails, you cannot send 200 emails/second. But you can send 200 emails / 2 minutes or so. This is what I was telling you.
Member 10184740 15-Apr-15 1:43am    
Ok leave the speed can you provide me method for sending mail using multithread
in java

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900