Speed up sending multiple emails through smtp server using System.Net.Mail Speed up sending multiple emails through smtp server using System.Net.Mail multithreading multithreading

Speed up sending multiple emails through smtp server using System.Net.Mail


simply use multiple threads (multiple processes).

In C# you can do this with a Task.

new Task(delegate {     smtpClient.send(myMessage); }).Start();

Just wrap your send command in this object and it will be send Asynchronously.

Be careful if this is wrapped in a loop it will start a new process for each mail.

if you need to send large amounts of mails at the same time I suggest you use a ThreadPool. It lets you control how many concurent threads you'd like to have at the same time.