Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Send mass emails with ASP.Net

Tags:

c#

asp.net

What is the best way to send mass emails using ASP.Net?

For example a site administrator needs to send email (e.g. a newsletter) to all of his site’s users.

What is the best way to do this with ASP.Net 3.5 and C#?

like image 312
Babak Avatar asked Jul 29 '09 04:07

Babak


People also ask

How do I send mass emails?

For sending, you can use an SMTP server from a bulk email service or free email provider. Note that to successfully send mass emails with a free email provider (without having a portion of your messages undelivered, blocked, or moved to a Spam folder), you'll need to follow the provider's Bulk Email Sender Guidelines:

How to send bulk email using ASP NET Web Forms?

This article explains how to send bulk email using ASP.Net 4.5. Create a new project using "File" -> "New" -> "Project..." then select web "ASP .Net Web Forms Application". Name it " Bulk Email". ID="Label1" runat="server" Font-Bold="true" ForeColor="Green" Text="Total Customers:">

How to send bulk (mass) email using checkbox?

One can select the users to whom the email has to be sent using CheckBox and when the Button is clicked, Bulk (Mass) email will be sent to all selected users using Parallel ForEach Loop.

How to send mass emails using database queue in ASP NET?

It is very useful to send mass emails in ASP.NET/C# web application. To better understand how to use database queue, we need to create three tables in your SQL database like this: Then insert two records in table ‘rcpts’ like this: Remarks: All of samples in this section are based on first section: Send email in a simple C# project.


2 Answers

Edit per Troy's comment.

You should use an external process to send the emails. If your email list grows to a few mere hundred you'll run into timeouts in no time. Once you get into the lists that are a thousand or a million records long you can forget about any workable solution using ASP.Net alone.

I've actually developed a windows service that handles sending out mass emails. Basically in ASP.Net I create a campaign and a batch job in various db records and then insert a list of recipients as well. Once the job has been fully written to the db it's status is changed so that the Windows Service knows it can come along and start processing the job. Then the ASP.Net site can look at the records at any time to determine how far along the service has gotten.

like image 167
Spencer Ruport Avatar answered Oct 13 '22 16:10

Spencer Ruport


If I were writing this on my own, I would simply get the email addresses from the database and loop through using the System.Net.Mail.SmtpClient class.

Please, however, ensure that you are aware of the CAN-SPAM act and that you follow the guidelines.

like image 23
David Avatar answered Oct 13 '22 16:10

David