Realization of mailing list function in ASP environment (I.)

Source: Internet
Author: User
Tags date include mail one table web services access database
The mailing list (mailing list) is one of the most popular Web services currently. Through the construction of a sample system, this paper introduces the realization method of mailing list function in ASP environment.

Chinabyte Network College's "Java Mail API and its applications," the article introduces the simple mailing list service function in Java, this paper introduces the implementation of similar functions in ASP application. We will specify the implementation process through an example system.

I. Overview of the SYSTEM

The whole application system can be divided into two parts, namely the function of the end user and the function oriented to the management task. End-user-oriented features include: Provide input interface for users to enter personal information (user name and email address, etc.) and register it to the "customer register" to provide "unsubscribe mailing list" feature.

Administrators should pass simple security checks before accessing the admin interface. After successful entry into the admin interface, the actions that an administrator needs to perform include viewing, editing, and deleting user records, editing messages, and sending messages to all subscribers.

Sending a message to a subscriber needs to be done with a server part. In this implementation we will use the Serverobjects Aspmail 3.0. According to the company's website, in all commercial or free similar products, aspmail in the ASP environment is the most widely used, including Microsoft, Intel, HP and many companies are using Aspmail, from its web site can download a trial version. The trial version of Aspmail will be accompanied by a copyright notice at the end of each message sent by it. Of course, other similar server parts can be selected, including the JMail and Cdonts.newmail objects provided by the NT Server (Service Pack 4). Below we briefly introduce the use of these two parts, you can follow the introduction here to replace the aspmail in this article implementation.

CDONTS is only available on NT servers. Aspmail, in addition to NT servers, workstations can also be used for Win9x. CDONTS is the abbreviation for the collaboration Data Objects for NT server, and the sending task of a message can be completed with its NewMail object. Unlike Aspmail and JMail, the NewMail object does not require SMTP server information to be specified, and it always assumes that the message was sent through the mail service installed on the local machine. The VBScript code for sending a simple plain text message is as follows:

' Create a NewMail object instance
Set mail = Server.CreateObject ("CDONTS. NewMail ")
' Set the recipient, sender, etc information
Mail. from = ""
Mail. to = ""
' Message content
Mail. BODY = "message content."
' Send mail
Mail. Send
Set mail = Nothing

JMail is completely free and developed by Dimac. The code used to send the message is:

' Create object
Set JMail = Server.CreateObject ("Jmail.smtpmail")
' Specify mail server
jmail.serveraddress = ""
' Sender, Recipient, subject
Jmail.sender = ""
Jmail.addrecipientex "Guest0", ""
Jmail.subject = "message subject"
' Message content
Jmail.body = "message content"
' Send mail

We use Access database Guestbook.mdb to store user information. The database contains only one table guests. The field names of the guests table and their types are as follows:
Guests table Structure
Field Name Type size description
GUEST_ID automatic numbering long shaping primary key
Guest_name Text 50
Guest_email Text 50
Mail_list Yes/No
Sign_date Date/Time
Guest_comment Text 255

Each user record requires a unique identity, so we define the guest_id field here as an AutoNumber type. Setting the Mail_list field to a Yes/no type allows us to quickly and easily check whether the user wants to join the mailing list. The Sign_date field holds the user registration date, and the default value is set to now (). The meaning of all other fields can be seen from its name

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.