In this section you will add the capability to send the message through e-mail.
There are two steps involved in the implementation:
Open the index page. To retrieve the correct address, you will have to add a filtered recordset into the page. To correctly configure it, follow the instructions below:
Click on the Plus (+) button of the Bindings tab. If the Bindings tab is not visible, open it from Window -> Bindings.
In the menu that appears, select Recordset (Query ). The new recordset dialog box will then open.
Give the recordset a significant name (e.g. rsMail)
Select your database connection and the department_dep table.
At this point the recordset grabs all departments,
so you will add a filter to just grab the one you need :
· In the
Filter drop-down menu select the department's
unique identifier, which must be equal to a Form
Variable. The form variable's name must be written in the text
field. In this case, it is id_dep_con. Either
type it, or paste it in the text-box.

· Now, the
recordset only retrieves one department: the one selected in the form.
Click the recordset dialog box's OK button
to apply the changes.
For the second part of the enhancement, the e-mail sending operation, you will use the Send E-mail trigger. Follow the next steps to add it:


Note: If using the ASP VBScript server model you must configure the E-mail server settings in the Control Panel. You must fill in the server address (or name), the port (by default it is 25), user name and password. Optionally, you can also set the default sender field.
Save the page and preview it in the browser. Fill in a message for a department, and submit the page, similar to what you've done as a test in the previous section. Only that now you just need to check that department's e-mail to read your message.
The message in the contact form, as seen in the browser:

The mail message delivered to the department:

With the contact form now complete, you can move on to the next tutorial: building a Content Management System.