In this tutorial I intend to teach you how to take a user entered email address and validate it on the server side. Mind you we're not checking to see if it actually exists, as if we could, but rather if it is in the correct syntax of a valid email address.
The NewMail object gives you the ability to send a message within an ASP page with only few lines of code. The syntax for sending mail with the NewMail object of CDONTS is as follows:
I've always offered you the source code for my forms (in fact you can download the entire site), but it's now time to step through the code with you and explain the code in more detail.
Now let’s open up the Actions panel and start typing some codes. We’ll be doing a few things here. I won’t be able to explain every detail about everything used because this tutorial would be way too long. We’re simply going to use a flash object called “LoadVarsâ€. We’re also going to surround the whole thing inside an “onRelase†function for the submit button. We will also do some data validation. Also note, there is some extra code, simply for the sake of this tutorial that will allow you to decide whether to use the ASP, PHP, or Perl file. Here’s the code
Before the sending of a mail to avoid a useless excess load on IIS, it is possible to use a simple function to verify that the email address is well formed. In a more pushed process we could be also brought to interrogate the smtp corresponding server to know if the address exists or not.
Joining mailing list will entitle you
to receive occasional emails informing you of news and
updates to the site and any special offers that may be
of interest to you.