Click here to Skip to main content
15,880,796 members
Articles / Web Development / ASP.NET
Article

Bulk Email Sender & Extractor

Rate me:
Please Sign up or sign in to vote.
2.46/5 (32 votes)
24 Feb 20042 min read 182.9K   6.8K   64   20
Bulk Email Sender & Extractor

Image 1

Introduction

I use this code to collect related emails & send newsletters to my customers. I don't use it to send Junk mails to others, so I do not know about the filtering for different mail servers and these kind of usages. I also use it to extract emails from a complex text file (containing email addresses and other texts).

Using the code

There are two parts: first gathering and collecting email addresses in database and the second is sending email. For extracting emails easily copy the text containing emails & paste in to the textbox AddBulkEmail.aspx. It will extract and save email addresses to the MailingList.mdb file. After that, in Default.aspx I send my emails to the addresses.

Before using, set the web.config file. I set 4 variables in web.config:

  • SMTPServerName is the name of the mail server which you are working with.
  • SampleEmailAddress is the email address which you send sample email for testing and checking the content of your email before sending to the others.
  • UDLPath is the address of the file which includes the connection string.
  • MatchExpression, there is no need to change it, I placed it here because I thought may be some times I want to change the filtering for extracting emails; and easily I change the web.config file.

    In the main.udl file set your physical path for MailingList.mdb.

(The name of application which I tested in my local machine is http://localhost/emailer, so you may need to create it in your IIS)

Points of Interest

I think it needs an automated un-subscriber at the end of every mail which I send to unsubscribe users from my mailing list. I also do not know if there is any problem in sending email to unknown people!

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
President Momentaj Inc.
Canada Canada
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
Questiontnx Pin
Member 1030318328-Jul-14 10:12
Member 1030318328-Jul-14 10:12 
Questionplease provide me C# code of this emailer. Pin
Member 83753904-Nov-11 3:25
Member 83753904-Nov-11 3:25 
GeneralMy vote of 5 Pin
digjam94229-Mar-11 20:21
digjam94229-Mar-11 20:21 
GeneralNot working... Pin
Sandeep Mewara23-Jan-10 6:46
mveSandeep Mewara23-Jan-10 6:46 
GeneralHelp plz plz plz Pin
ghazalhina14-Jul-09 9:13
ghazalhina14-Jul-09 9:13 
Generalhello Pin
mohsen nourian20-Apr-09 5:17
mohsen nourian20-Apr-09 5:17 
Questionc# version ? Pin
desmat992-Nov-05 13:04
desmat992-Nov-05 13:04 
GeneralCould not access 'CDO.Message' object. Pin
hemachaudhry28-Jul-05 22:08
hemachaudhry28-Jul-05 22:08 
Generaldb Pin
paul.g.delanoit@wellsfargo.com15-Jun-05 9:40
paul.g.delanoit@wellsfargo.com15-Jun-05 9:40 
GeneralRe: db Pin
hemachaudhry28-Jul-05 21:47
hemachaudhry28-Jul-05 21:47 
GeneralHTML Pin
Member 150704417-Nov-04 1:45
Member 150704417-Nov-04 1:45 
Generalsalam Pin
dSolariuM18-Oct-04 4:03
dSolariuM18-Oct-04 4:03 
GeneralRe: salam Pin
Amir Pournasserian18-Oct-04 6:12
professionalAmir Pournasserian18-Oct-04 6:12 
Generalcan't get it to work Pin
mackbest19-Aug-04 23:17
mackbest19-Aug-04 23:17 
GeneralRe: can't get it to work Pin
Anonymous30-Sep-04 2:17
Anonymous30-Sep-04 2:17 
GeneralRe: can't get it to work Pin
ahpeeyem1-Nov-04 19:45
ahpeeyem1-Nov-04 19:45 
GeneralRe: can't get it to work Pin
Anonymous17-Mar-05 8:46
Anonymous17-Mar-05 8:46 
GeneralRe: can't get it to work Pin
hemachaudhry28-Jul-05 21:44
hemachaudhry28-Jul-05 21:44 
GeneralSo you're the guy Pin
coder4rent2-May-04 14:57
coder4rent2-May-04 14:57 
GeneralSPAMMER Pin
abhadresh2-May-04 15:36
abhadresh2-May-04 15:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.