What is the best way to send large batches of emails in ASP.NET?

后端 未结 2 1114
青春惊慌失措
青春惊慌失措 2021-01-18 16:40

I\'m currently looping through a datareader and calling the System.Net.Mail.SmtpClient\'s Send() method. The problem with this is that it\'s slow. Each email takes about 5-1

2条回答
  •  感动是毒
    2021-01-18 17:27

    You could send the mail asynchronous. That way the timeout should not interrupt your sending.

    This article should help you get started with that: Sending Emails Asynchronously in C#.

    There is another approach here: http://www.vikramlakhotia.com/Sending_Email_asynchronously_in_AspNet_20.aspx

    And off course there are several commercial clients available, but the only one that i have tried and can recommend is http://www.aspnetemail.com/

提交回复
热议问题