Using MailMerge on FreePages
The MailMerge CGI script has been installed on the FreePages server and is available to webmasters. This script will allow you to put forms on your web pages and have the results of the form sent to you in an e-mail message. You also have the option of having the data from the form posted to a web page so that it can be viewed immediately. This gives you the ability to build a feedback form, guestbook, or the like.
Basic documentation on how to use MailMerge is available in the RootsWeb Wizards pages at http://www.rootsweb.com/rootsweb/wizards/basicmm.html. Detailed documentation is provided at http://www.rootsweb.com/rootsweb/wizards/mailmerge.html
When using MailMerge on FreePages, there are some differences in how you will code your PathName in your <form> tag and in your template file.
Only a relative path will work in your <form> tag. Here's an example of the <form> tag in one of the samples:
Using the relative path of ~elsi, this form will work within any of your community directories on the FreePages server. You could put the form in your genealogy_html directory or in your arts_html directory along with its template file and the form would work without any changes.
Here are examples for using MailMerge forms:
The Input Form
The input form for both our examples is identical except for the template file referenced in the <form> tag.
<INPUT TYPE=hidden NAME="mgr_name" value="Leigh Compton">
<INPUT TYPE=hidden NAME="mgr_email" value="firstname.lastname@example.org">
<table border="0" cellpadding="0" cellspacing="0">
<td><input type="text" size="35" maxlength="50" name="Name"<>/td>
<td><input type="text" size="48" maxlength="75" name="EMail"></td>
<td>Home Page URL: </td>
<td><input type="text" size="48" maxlength="75" name="URL"></td>
<p><textarea name="Comment" rows="12" cols="60"></textarea></p>
<p><input type="submit" value="Submit Comment">
<input type="reset" value="Clear Form & Start Over"></p>
You can View or test the input form
The template for this form (maillist.tmp) contains a simple set of directives for building an e-mail message from the data collected in the form:
# template: maillist.tmp
# This example uses a "Mail" action to send the output form
# to the webmaster via e-mail
SUBJECT=Feedback and Comment
TITLE=Your message request has been sent!!<br><br>**DO NOT** Hit the "Back" Button on your Browser unless you would like to send another comment.<br> <br> <a href="http://freepages.computers.rootsweb.com/~elsi/">Return</a> to the main page.
ADDRESS=<A HREF="http://freepages.computers.rootsweb.com/~elsi/">RETURN to the Main Page</A>
# This is the e-mail header.
X-mail-agent: mailmerge v1.0
# The output form that is sent via e-mail
Posting to a web page
The template for this form (query.tmp) contains a simple set of directives for creating a "guestbook" message from the data collected in the form:
# template: query.tmp
# This example uses a "File:" action to append the output form
# to a file. This can be used to create a simple Guestbook.
# This is the file that the entry gets appended to.
# Since we're writing out a file to be viewed as HTML, we
# set ESCAPE_HTML to true in order to prevent users from
# entering incorrect codes that will mess up the formatting.
# The output form that is written to the file.
<!-- Referer=@REFERER@, User=@REMOTE_USER@, Host=@REMOTE_HOST@ --> </p>
When you want to write to a file as in the above example, your template must use an absolute pathname to your output file. (This is the opposite of your input form which must use a relative pathname.) Due to the directory structure on the FreePages server, you cannot use a relative or URL-format pathname as described in the MailMerge documentation.
The absolute pathname for your file is formed from the first four characters of your userid/account name. For example, a file in the computers_html directory in account elsi, which is referenced as http://freepages.computers.rootsweb.com/~elsi/output.filename, has a pathname of
Likewise, a file in the arts_html directory of account linda, which is referenced as http://freepages.arts.rootsweb.com/~linda/output.filename, has a pathname of
If you have further questions about using MailMerge on the FreePages server, please post your question to the FreePages-Help mailing list. All those who were assigned web space on the FreePages server were automatically subscribed to the digest version of this list (FreePages-Help-D). If you have unsubscribed, you will need to subscribe again before you can post to the list. Information on subscribing can be found at http://freepages.rootsweb.com/help.html.