|
It is not uncommon for web developers to wish to create various forms on their web sites and have the results emailed to someone. This can be done using our services by following the following procedures.
- Create your form. This can be of any length and contain any combination of fields. Three special fields do need to be included in the form either as hidden fields or entered TEXT type fields (described below)
- Make sure that the form action is a POST action and that it is directed to another page. This other page, typically a "Thanks you for your information" page needs to have a .ASP extension.
- The form needs to include the following three fields either as hidden or as text entry fields:
- recipient - the email address of the person to receive the email
- subject - the subject of the email when it is delivered
- sender - the email address of a person that the message is from. It is important that the sender field be a real address in case someone replies to this message.
- Aside from your thank you statement on the .ASP page that this form points to, you must include the following HTML exactly as you see here:
<!--#include virtual=includes/tools.asp--> <%sendformemail%>
These statements can appear anywhere in the .ASP page's HTML.
The three fields, recipient, subject, and sender can be specified as hidden fields, embedded in the form using statements like:
<input type=hidden name="recipient" value="joe@someaddress.com">
or you may wish to include them in the form itself, especially if the form includes an EMAIL ADDRESS field, in this case you can set the results to be emailed to you directly from the person's own email address which will make it easy for you to reply. This is very usefully for a "comments" or "feedback" form. The same is true if you have a field called "regarding" or "subject", then you can specify this field as being the subject of the message, also making it convenient to reply and manage the results as an email message.
Custom Message If you find you wish to send a custom message as the results of the form (usually in the case of asking the person to simply supply an email address), you may do so by using the field name msg. When used in conjunction with the special parameter sendvars, only the message you defined will be sent. For example:
<input type=hidden name="sendvars" value="no"> <input type=hidden name="msg" value="Thank you for visiting|our web site">
In the above example, you must specify the value "sendvars=no" so that the other form elements are not transmitted and the message:
is sent. Note that the vertical bar or "pipe" symbol ( | ) is translated to a carriage return in messages.
Ordering the form results Due to the way certain browsers handle form results, the resulting email will may have the fields in a strange or discontinuous order. If you wisht to have the fields ordered in a particular way, simply define an additional hidden field called formorder. List all your fields separated by a pipe symbol ( | ) and the resulting email will list the fields in that order:
|