An ASP Tutorial to create your own News Letter News letters are part and parcel of every good site on the web today. When a web site visitor enters it's email address into the news letter input box, it is saved into the database. As more and more visitors enter their email addresses, the mailing list grows. Then when ever the you want, you can send emails in one go to all the users of your mailing list. News letters are a great way to inform web site users of latest news and information about your web site. High-end commercial email component : In this article I will guide you through the steps of creating a simple but effective news letter. We will divide our work into three steps :
Alright then lets now move to the creation of our News Letter messaging system. Simple HTML Form News Letter : Above HTML code will produce a simple input box where users can enter their email addresses. After entering their email address and pressing the 'submit' button, the users email address will be ported to our 'mail_ac.asp' page where the email address will be inserted into the database. You can edit it to suite the design of your site. Form Action Page This 'mail_ac.asp' page will first check to see if the user has just pressed the 'submit' button and has not entered the email address, if it is so then the user will be redirected back to the 'mail.htm' page. If the user entered it's email address then first check database to see if it's already present or not. If email address is not found in the database then add it otherwise tell the user that the email address is already present and exit. Simple Access Database Users - Table Ok, we've completed first two steps. Now we'll move on to the next page where we will create 'admin' page and an email deletion page from where users can delete their email addresses from your database. We have created an HTML Form to receive user's email address, an ASP action page to insert that email address into the database and an Access database to receive and store those email addresses. We will now create an admin page from where we can send emails to all the users on our mailing list at once and an email deletion page from where users can delete their email addresses if they later want to. HTML Admin Page Save it as 'admin.htm'. All it will do is to provide you with an online Form from where you can send messages to all the users of your mailing list. ASP Admin Action Page |
Done sending emails to all the users in our mailing list. Lets now create a 'del.asp' page whose link we have already added in our messages. Users will be able to delete their emails from out database if they want it by clicking the link we provided to them in their emails.
Note if you are getting errors when testing this script on your own computer, then search in the 'windows/sytem/' diretory ( win95/98 users ) or 'winnt/system32' directory ( winnt/2000 users ) if 'cdonts.dll' is present there or not. If it's not then get it from the Windows CD or search it on www.microsoft.com. You should change the URL provided in above code for the email deletion page to the URL where that 'del.asp' page will actually reside.
ASP Email Deletion Page
Create a new page and add the following lines of code into and then save it as 'del.asp' in the same folder where you have kept other pages :
We are now done with creating our ASP based news letter for our site. I have delibrately kept things simple so that beginners can also understand whats going on. You can add your own features to it as you want.