how can send bulk emails to members via ASP.NET. for example send email for 100,000 members. in typical sending, asp.net throw exception.
please help me.
how can send bulk emails to members via ASP.NET. for example send email for 100,000 members. in typical sending, asp.net throw exception.
please help me.
Simply add emails (which you may retreive from a database i guess) to the Bcc part of your MailMessage seperating them with a comma, which looks something like this:
System.Net.Mail.MailMessage mm = new System.Net.Mail.MailMessage();
mm.Bcc.Add("[email protected], [email protected], [email protected]");
mm.Subject = "Subject";
mm.Body = "Body";
System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient();
client.Send(mm);
See followings:
http://stackoverflow.com/questions/306844/building-a-bulk-mail-sender
http://stackoverflow.com/questions/1607012/net-service-application-sending-mail-to-2-634-789-users
The bottom line is, this is not something you want to do.
ASP.NET was not designed to house a SMTP server inside of it's process.
If you realloy want to send out 100K emails, then you need to write your own console.exe app or a windows service to do this.
If you insist on doing this within ASP.NET your code needs to be super tight, and catch numerous exceptions, along with being able to handle multiple starts/stops/restarts without duplicating sent emails.
Cheers! Dave