Mergemail for Freepages - email hints
I am used to the ease of using FrontPage or Navigator to set up reply-back forms, and found the Mailmerge instructions a little confusing. Here are some things I ran across in getting Mailmerge to work...
For Mergemail to work you will need 2 files:
1st: the .htm which has the form to be filled out. It will either be on or somehow linked to your index page. It is referred to as the "form" on most of Rootsweb's Mailmerge instructions, and
2nd: a .txt or .tmp file (such as created in Word or Notepad, and saved with the .txt or .tmp extension), referred to as the "template" on most of the Mailmerge instructions. This file will contain the email address(es) to which the information on the form will be emailed to, how you want it displayed in the email you receive, and some information the person filling out the form will see after they've hit the send button on the form on your web page.
When the send button is pressed, the data on the form will be sent to the Mailmerge server, which reads the template and emails the data from the form per the instructions on the template.
A few things to think about when trying to get Mailmerge to work correctly:
Some hints for the FORM -
The location and name of your template file has to be entered on the form correctly. For Freepages, as of May 2008 the following works:
<form action="/cgi-bin/mailmerge.cgi/~myfreepagesid/mytemplate.tmp" method="POST">
the tilde (~) and your freepages account name goes in place of what's in red
your template name goes in place of what's in blue
The following is the html coding used to produce the form illustrated below. The above mentioned form action code was placed just following the line "Thank you for reporting broken links."
<form action="/cgi-bin/mailmerge.cgi/~myfreepagesid/mytemplate.tmp" method="POST">
<textarea name="MESSAGE" rows="8" COLS="101"></textarea>
<STRONG>Your Name: </STRONG><input type="text" name="NAME" SIZE=43></p>
<STRONG>Your Email address: </STRONG><input type="text" name="EMAIL" SIZE=43>
Would you be interested in having your email address shared with people with similar research interest? <INPUT TYPE="radio" NAME="PRIORITY" VALUE="Yes">Yes
<INPUT TYPE="radio" NAME="PRIORITY" VALUE="No">No
If yes, please fill out the following:
<STRONG>Family, surname or subject you are interested in: </STRONG><input type="text" name="INTEREST" SIZE=34></p>
Please limit requests to subjects, surnames or locations listed in this web
site. Thank you.
<p><INPUT TYPE="reset" VALUE="Clear Form">
<INPUT TYPE="submit" VALUE="Send"></p>
<p class="center">Note: A new window will open to confirm that your message has been
sent. Click on your browser's BACK key to return to this page.</p>
This form has a large scrolling window, defined by the textarea name "MESSAGE". It also has short windows for inputting text, defined by the names "NAME", "EMAIL", and "INTEREST", radio buttons defined by the name "PRIORITY" which have different values, and buttons to either clear the form or send the message. It also has a boxed in area, defined by the term "fieldset".
Some codes used are   for spacebar; <br> appears to be line break, <p> looks like paragraph
For every beginning "carrot", there is an ending one somewhere; for every beginning quote there is an end one. The ending of an action appears to be defined by a / placed before the term. Examples of this are </fieldset> and </form>
One of the big things to remember is that you must spell your "names" (eg name="NAME", name="EMAIL", textarea name="MESSAGE") consistently, with the same capital and/or lower case characters on both the form and the template.
Some hints for the TEMPLATE -
The template cannot be created in FrontPage because it has to be saved in .txt or .tmp format. Save as .txt format in Word,. In Notepad you can save as a .tmp by changing file type to "All Files" and physically typing in the .tmp extension after you name your template. Just remember when opening a .tmp file in Notepad to select "All Files" for file type or you won't see it in your listing.
Your template for emailing will consist of 3 parts: Action, Mail_Header and Output_Form. They must have a dot or period after each part. Make sure there are no spacebars on the same line after the dots/periods.
A few things about the template:
A pound sign in front of a line, such as are on a lot of the Freepages examples, means those lines are to be disregarded by Mergemail, and the information is for the user's use only.
Most of the Mailmerge helppages say not to put any html code on the template. The only html code on the following template is the <br> at the end of the TITLE line, and that is a mistake. As you can see in the Thank You illustration (below) of the screen seen by the sender after the Send button is clicked, the <br> doesn't show up in the message itself, but it does show in the Internet Explorer window just above it. In some cases html code on a template will show up where you don't want it.
The words placed between a pair of @ signs often refers back to the names in quotes on your form, and must be spelled with capital/lower case exactly as on the form. To keep things simple you can also place new definitions on the template by using =. These definitions can then be easily repeated in the template by using the two @ signs. Two of these kinds of definitions on the following template are for SUBJECT and TO. Just remember that the spelling and capital/lower case consistency is needed for these to work, too.
Freepages MailMerge system automatically recognizes some "names" on templates such as TITLE and DATE, and all of the standard email header items, including CC and BCC, which weren't used on this template. "To" and "From" are recognized as standard email headers; trying to use Send To: or Sent From: on the Mail_Header probably will not work. You can, however, customize the labels for the Output_Form. Just be careful with what's between the @ signs.
The following is the text used on the template for the previously illustrated form:
SUBJECT=Lorenz-Gilliam Web Message
TITLE=Thank you. Your message has been sent.<br>
# This is the e-mail header telling where to email messages
Reply to: @EMAIL@
X-mail-agent: mailmerge v1.0
Date Sent: @DATE@
Share email address? @PRIORITY@; Subjects of interest: @INTEREST@
Templates must be uploaded in ASCII format. Apparently Rootsweb offers an FTP uploader that shouldn't be used to upload template files because it can't upload in ASCII format. An FTP uploader such as WSFTP may be needed.
Both the .htm with the form, and the .tmp file were uploaded into the same folder (in this case, Genealogy).
After uploading the form and template file, and viewing the form online using Internet Explorer, the following is the message that popped on the screen after the Send button was clicked:
Just for test purposes, on the form I had typed in some junk text for Message, Name, Email, Interests and had clicked the Yes radio button, and this thank-you form reflects that.
The email popped into my inbox pretty quickly when things worked right.
Some Freepages instructions recommend putting a note to use the browser's BACK button to get the sender back to the page with the form; some Rootsweb instructions mention a way to put something with a hyperlink back to one of your home pages on the template. I haven't yet gotten the hyperlink idea to work, so have opted to take the easy way out. If anyone has worked the hyperlink problem out I'd love to hear how it was done.
It took me a week and a half and a few gray hairs to get this to work correctly. Rootsweb appears to have tried to write their instructions as generic as possible to cover a lot of bases. I also wondered if some of the older instructions were real accurate after they upgraded things a couple of years ago. I'm sure my simplified explanations won't satisfy the purists :) And I know there are some thing on the form and template for which I can't explain their use, but they seemed to be used in the great majority of the Mailmerge samples, so I included them in my coding. Anyway, I hope this, if nothing else, will help some of you to better understand some of the Freepages instructions. If anyone sees anything that's way out of line, please let me know. I don't wish to add to the confusion.
My original form is at http://freepages.genealogy.rootsweb.com/~katloregen/emailme.htm