For AspEmail email form results - create 2 files - form.html and sendmail.asp. You can use an existing form page in place of the form.html form page -- it will need to call the sendmail.asp page in it's action. You can add additional fields and you can remove unwanted fields. Make sure the field names are located in both files and spelled exactly the same. The form page can be customized using a wysiwig web page editor or by hand coding, and the script page can be changed by hand coding. You need to replace "youremailaddress@yourdomain.com" in the sendmail.asp script page with your email address.
http://aspemail.com/manual.html is the location of the AspEmail manual in case you want to use AspEmail's advanced features. Some customers have found the AspEmail manual to not be so straight forward, and so we have explained below in blue text how to customize the form page and script page in straight forward language, explaining how to use wysiwyg view in a web page editor program as well as within the code itself.
contact.html example form page (can be named anythingyouwant.html)
|
<HTML>
<BODY BGCOLOR="#FFFFFF"> <% If strErr <> "" Then %> <h2>Contact Us</h2> <p> </p> <% End If %> <FORM METHOD="post" ACTION="sendmail.asp"> <TABLE CELLSPACING=0 CELLPADDING=2 BGCOLOR="#E0E0E0"> <TR> <TD>Name:</TD> <TD style="width: 361px"> <INPUT NAME="Name" style="width: 213px"></TD> </TR> <TR> <TD>Telephone:</TD> <TD style="width: 361px"> <INPUT NAME="Telephone" style="width: 179px"></TD> </TR> <tr> <TD>Email Address:</TD> <TD style="width: 361px"><INPUT NAME="Email" style="width: 239px"></TD> </tr> <TR> <TD>Company:</TD> <TD style="width: 361px"> <INPUT NAME="Company" style="width: 287px"></TD> </TR> <TR> <TD>Street Address:</TD> <TD style="width: 361px"> <INPUT NAME="Address" style="width: 287px"></TD> </TR> <TR> <TD>City:</TD> <TD style="width: 361px"> <INPUT NAME="City" style="width: 238px"></TD> </TR> <TR> <TD>State:</TD> <TD style="width: 361px"> <INPUT NAME="State" style="width: 107px"></TD> </TR> <TR> <TD>Zip Code</TD> <TD style="width: 361px"> <INPUT NAME="Zip" style="width: 147px"></TD> </TR> <TR> <TD>Country</TD> <TD style="width: 361px"> <INPUT NAME="Country" style="width: 238px"></TD> </TR> <TR> <TD>Comment / Question:</TD> <TD style="width: 361px"> <TEXTAREA NAME="Comment" style="width: 510px; height: 131px"></TEXTAREA></TD> </TR> <TR> <TD COLSPAN=2><INPUT TYPE="SUBMIT" NAME="Send" VALUE="Send Message"> </TD> </TR> </TABLE> </FORM> </BODY> </HTML> |
|
|
<%
strHost = "smtp.w2k3.usbusinessweb.net" If Request("Send") <> "" Then Set Mail = Server.CreateObject("Persits.MailSender") Mail.Host = strHost Mail.From = Request("Email") Mail.FromName = Request("Name") ' optional Mail.AddAddress "youremailaddress@yourdomain.com" ' message subject Mail.Subject = "Web Site Comment / Question" ' message body Mail.Body = "Name:" & chr(9) & Request("Name") & chr(13) & chr(10) & "Telephone:" & chr(9) & Request("Telephone") & chr(13) & chr(10) & "Email:" & chr(9) & Request("Email") & chr(13) & chr(10) & "Company:" & chr(9) & Request("Company") & chr(13) & chr(10) & "Address:" & chr(9) & Request("Address") & chr(13) & chr(10) & "City:" & chr(9) & Request("City") & chr(13) & chr(10) & "State:" & chr(9) & Request("State") & chr(13) & chr(10) & "Zip:" & chr(9) & Request("Zip") & chr(13) & chr(10) & "Country:" & chr(9) & Request("Country") & chr(13) & chr(10) & "Comment:" & chr(9) & Request("Comment") strErr = "" bSuccess = False On Error Resume Next ' catch errors Mail.Send ' send message If Err <> 0 Then ' error occurred strErr = Err.Description else bSuccess = True End If End If %> <HTML> <BODY BGCOLOR="#FFFFFF"> <% If strErr <> "" Then %> <h2>Error occurred: <% = strErr %></h2> <% End If %> <% If bSuccess Then %> <h2>Thank you, form submitted!</h2> <% End If %> </BODY> </HTML> |
You add a new form field by inserting a row in the table in contact.html, and copy/paste another field, then change the new field’s name and perhaps type or size, and then rather than open sendmail.asp within your wysiwig design view in your web page editor program, you open it with a text editor, or you change to code view, making sure to add the field in that file as well.
The easiest way to change the name of a form field is within your
wysiwig design view – but it can be changed in the code if you
take a look at the code of the fields – you’ll see which one has
been copied and you’ll know to change one of them as you can only
use a field name once, each field name must have its own unique name
similar to a database field.
You can change the design of the form page by linking your css
page to it of course, or by changing it in your wysiwig design view
of your web page editing program, or by within the code, so it
matches the rest of your site, just as you would customize the
design of any of your web pages.