This page shows how to use BT's form to email service from WAP cards. For more information on writing WAP pages, visit W3Schools. In my opinion this is the best site on the web for learning HTML, XHTML, JavaScript, CSS, WAP, WmlScript, XML, whatever.

This page assumes you understand how to write wml and that you have read BT's Form to Email page.

Unfortuneatly, at present the BT cgi page tries to download the response file if it is not a .htm file. So although the email is sent, the wap device will give an Invalid Page error instead of the wml page you want. Hopefully this will change in future.

Two examples are given. The first uses a link to submit the form, the second adds an entry to the wap device's option menu (less desirable in my view).

Run the examples on your wap device at: http://www.stephenwaring.btinternet.co.uk/c2e1.wml and http://www.stephenwaring.btinternet.co.uk/c2e2.wml or try a wap emulator

Text shown in this colour indicates standard wml requirements.
Text shown in this colour indicates wml good practice, don't leave your caller stranded without a back option.
Whilst most of the example will need to be changed to be of any use, text shown in this colour must be changed for the example to work as is.

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<template>
<do type="prev" label="Back"><prev/></do>
<do type="accept" label="My Home page"><go href="home.wml#card1"/></do>
</template>
<card id="example" title="Card to Email">
<!-- fieldset and optgroup are also useful tags to use with wap forms.-->
<!-- Formats are described at http://www.w3schools.com/wap/tag_input.asp, numeric input might place a wap phone into numreic rather than letter input. It might limit the input to numeric characters and + - . , but don't count on it. -->
<p>Your name: <input format="*M" name="uname" title="Your Name"/><br/>
Your email: <input format="*M" name="uemail" title="Your Email"/><br/>
Your phone number: <input format="14N" name="uphone" title="Phone Number:"/><br/>
<!-- A set of Radio Buttons -->
Info required: <select name="show" value="details" title="Info:">
<option value="title">Title Only</option>
<option value="details">Details</option>
<option value="full">Full Description</option>
</select><br/>
<!-- A set of check boxes -->
Catalogue: <select name="cat" value="CD" title="Catalogue:" multiple="true">
<option value="CD">CD</option>
<option value="Vinyl">Vinyl</option>
<option value="Cassette">Cassette</option>
<option value="Video">Video</option>
<option value="DVD">DVD</option>
</select>
<anchor>Submit
<go method="post" href="http://www.btinternet.com/cgi-bin/userform.cgi">
<postfield name="FormTitle" value="Source of form"/>
<postfield name="SendMailTo" value="myuserid@btopenworld.com"/>
<postfield name="redirect" value="http://www.btinternet.com/~myuserid/c2e1.wml#resp"/>
<postfield name="uname" value="$(uname)"/>
<postfield name="uemail" value="$(uemail)"/>
<postfield name="uphone" value="$(uphone)"/>
<postfield name="show" value="$(show)"/>
<postfield name="cat" value="$(cat)"/>v </go></anchor></p>
</card>
<card id="resp" title="Done">
<p>Your request has been submitted</p>
</card>
</wml>

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<template>
<do type="prev" label="Back"><prev/></do>
<do type="accept" label="My Home page"><go href="home.wml#card1"/></do>
</template>
<card id="example" title="Card to Email">
<do type="accept" label="Submit">
<go method="post" href="http://www.btinternet.com/cgi-bin/userform.cgi">
<postfield name="FormTitle" value="Source of form"/>
<postfield name="SendMailTo" value="myuserid@btopenworld.com"/>
<postfield name="redirect" value="http://www.btinternet.com/~myuserid/c2e1.wml#resp"/>
<postfield name="uname" value="$(uname)"/>
<postfield name="uemail" value="$(uemail)"/>
<postfield name="uphone" value="$(uphone)"/>
<postfield name="show" value="$(show)"/>
<postfield name="cat" value="$(cat)"/>
</go></do>
<!-- fieldset and optgroup are also useful tags to use with wap forms.-->
<!-- Formats are described at http://www.w3schools.com/wap/tag_input.asp, numeric input might place a wap phone into numreic rather than letter input. It might limit the input to numeric characters and + - . , but don't count on it. -->
<p>Your name: <input format="*M" name="uname" title="Your Name"/><br/>
Your email: <input format="*M" name="uemail" title="Your Email"/><br/>
Your phone number: <input format="14N" name="uphone" title="Phone Number:"/><br/>
<!-- A set of Radio Buttons -->
Info required: <select name="show" value="details" title="Info:">
<option value="title">Title Only</option>
<option value="details">Details</option>
<option value="full">Full Description</option>
</select><br/>
<!-- A set of check boxes -->
Catalogue: <select name="cat" value="CD" title="Catalogue:" multiple="true">
<option value="CD">CD</option>
<option value="Vinyl">Vinyl</option>
<option value="Cassette">Cassette</option>
<option value="Video">Video</option>
<option value="DVD">DVD</option>
</select>
</card>
<card id="resp" title="Done">
<p>Your request has been submitted</p>
</card>
</wml>