Form Decode: Arrange the Layout of Received Email

What does it mean to arrange the layout of email?

Arranging the layout of email is to straightening out the email sent from Form Decode using a template file.

Arrange the layout of email

Layout of email can be arranged by specifying _template_mail for the NAME attribute of <INPUT> tag.

Layout of email can be arranged Email whose layout is arranged is auto-generated by the CGI program by putting together the information entered through Form Decode and the template file (extension should be .tpl). Please note that the Form to email template file is just a text.

Example of how to write and use (FreeAddress)

HTML file (Form Decode)

<BODY>
<form ACTION="https://cgi.www.ne.jp/cgi-bin/formdecode.cgi" METHOD="POST">
<input type="hidden" NAME="_template_mail" VALUE="seikei.tpl">
Name <input type="text" NAME="name"><br>
Gender <input type="radio" NAME="gender" VALUE="male">Male <input type="radio" NAME="gender">Female<br>
What is your favorite color?
<SELECT NAME="color">
<option selected>Please choose.</option>
<option VALUE="red">Red</option>
<option VALUE="blue">Blue</option>
<option VALUE="yellow">Yellow</option>
</SELECT><br>
Where do you want to go?<br>
<input type="checkbox" NAME="usa" VALUE="on">United States<br>
<input type="checkbox" NAME="china" VALUE="on">China<br>
<input type="checkbox" NAME="france" VALUE="on">France<br>
<input type="checkbox" NAME="germany" VALUE="on">Germany<br>
Comment<br><textarea NAME="comment" ROWS="4" COLS="30"></textarea><br>
<input type="submit" VALUE="Send"><input type="reset" VALUE="Reset">
</form>
</BODY>

An HTML file with <INPUT> tag which arranges the layout of email. <INPUT> tag should always be written in between <form> and .

Template file: seikei.tpl (arranging layout of email)

Name:$VAL{name}
Gender:$_IF{VAL,gender,male,Male,Female}
What is your favorite color?:$_SELECT{VAL,color,red,Red,blue,Blue,yellow,Yellow}
Where do you want to go?:$_IF{VAL,usa,on,United States/,} $_IF{VAL,china,on,China/,} $_IF{VAL,france,on,France/,} $_IF{VAL,germany,on,Germany/,}
Comment:$VAL{comment}

This is the Form to email template file (extension is tpl). Rewrite each item of Form Decode with special characters. Design could be made on your preferences. Text editor is convenient for writing.

Form Decode

Name 
Gender Male Female
What is your favorite color?
Where do you want to go?
United States
China
France
Germany
Comment

This is how Form Decode is shown in a browser. To check how it works, send as a test.

Receive test

Email header
Send to: ab4t-ash@asahi-net.or.jp
Subject: (output from formdecode.cgi)
Sender: ab4t-ash@asahi-net.or.jp
Body
Name: Asahi, Taro
Gender: Male
What is your favorite color?: Red
Where do you want to go?: United States/France/
Comment: Cheap

This is an email which is laid out based on the template file (seikei.tpl) and delivered.

Back to top of the page