| w3JMail Examples |
Examples 4.5
Automated Forms |
|
This is a different way to handle forms. Instead of specifyingeach field as in the forms example, we now read all form fields and paste their values into our e-mail. |
First, a sample form. Any form will do as long as it posts to our JMail page. |
JmailForm.asp
<html>
<head> <title>emailform</title> </head> <body> <form method="post" action="SendMail.asp"> Name <INPUT name="name" type="text"><br> Email<INPUT name="Email" type="text"><br> Company<INPUT name="company" type="text"><br> Occupation <SELECT name="state"> <OPTION value="coder">Coder <OPTION value="coder">Hacker <OPTION value="coder">Developer <OPTION value="coder">Guru </SELECT><BR> Favorite TV-show<TEXTAREA name="tv-show"></TEXTAREA> <br> <INPUT type="submit" value="Send"> </form> </body> </html> |
Now we use the forms collection to get all the fields and add their values to the e-mail. Unfortunately there is no way for us to control the order of the values. |
SendMail.asp<%@LANGUAGE = VBSCRIPT%> <html> <body> <%%> </body> </html> |
|
|