+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 19

Thread: Unable to get HTMLTemplate to work

  1. #1
    Join Date
    May 2006
    Location
    Chicago
    Posts
    30

    Default Unable to get HTMLTemplate to work

    I'm unable to get HTMLTemplate to work. I got PlainTemplate to work so I know that $TEMPLATEDIR (./) is set correctly. I am trying to use SampleGoodTemplate.htm as the template that get used. What I am getting is the same as if I did not have <input type="hidden" name="mail_options" value="SampleGoodTemplate.htm,TemplateMissing=n/a" />.

    Here are all my hidden fields:
    <form method="post" action="formmail.php" name="SampleForm">
    <input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER">
    <!-- STEP 2: Put your email address in the 'recipients' value.
    Note that you also have to allow this email address in the
    $TARGET_EMAIL setting within formmail.php!
    -->
    <input type="hidden" name="recipients" value="nms1944@yahoo.com" />
    <!-- STEP 3: Specify required fields in the 'required' value -->
    <input type="hidden" name="required" value="email:Your email address,realname:Your name" />
    <!-- STEP 4: Put your subject line in the 'subject' value. -->
    <input type="hidden" name="subject" value="Sample FormMail Testing" />
    <!--- Set up Bad Error handler & a template for it. --->
    <input type="hidden" name="bad_url" value="fmbadhandler.php" />
    <input type="hidden" name="bad_template" value="SampleErrorTemplate.htm" />

    <!--<input type="hidden" name="good_template" value="SampleGoodTemplate.htm" />-->
    <input type="hidden" name="this_form" value="http://localhost/Work/PHP/FormMail/SampleForm.html" />
    <input type="hidden" name="mail_options" value="PlainTemplate=Plain.txt,TemplateMissing=n/a" />
    <input type="hidden" name="mail_options" value="SampleGoodTemplate.htm,TemplateMissing=n/a" />

    Can anyone help????

  2. #2
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Unable to get HTMLTemplate to work

    <input type="hidden" name="mail_options" value="PlainTemplate=Plain.txt,TemplateMissing=n/a" />
    <input type="hidden" name="mail_options" value="SampleGoodTemplate.htm,TemplateMissing=n/a" />
    2 probs: u can only have one mail_options field, and u havent said "HTMLTemplate="

    u want:

    HTML Code:
    <input type="hidden" name="mail_options"
    value="PlainTemplate=Plain.txt,TemplateMissing=n/a,HTMLTemplate=SampleGoodTemplate.htm" />

  3. #3
    Join Date
    May 2006
    Location
    Chicago
    Posts
    30

    Default Re: Unable to get HTMLTemplate to work

    Thank you - it was the second one that caused the problem. I also found out that the PlainTemplate=Plain has an unprintable character at the end that was stopping it from working correctly.

    As for the first problem that was a cut & paste mistake - the source code had the PlainTemplate=Plain.txt line commented out.

    What I still don't understand is why use both PlainTemplate & HTMLTemplate together as mail_options.

    Now I'm going to try autoresponse.

  4. #4
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Unable to get HTMLTemplate to work

    What I still don't understand is why use both PlainTemplate & HTMLTemplate together as mail_options.
    normally u wouldnt

    but if some recipients have email progs that dont udnerstand html, then they can still read the results (in plaintext).

  5. #5
    Join Date
    Dec 2005
    Posts
    74

    Default Re: Unable to get HTMLTemplate to work

    Use both Plain & HTML templates when you want both the 'pretty' (HTMLTemplate) email and a formatted (PlainTemplate) csv attachment. Pretty is for the humans, csv for importing into the data base.

    George

  6. #6
    Join Date
    May 2006
    Location
    Chicago
    Posts
    30

    Default Re: Unable to get HTMLTemplate to work

    OK - I got mail_options to work perfectly. I then added the code for confirmation verification process - it worked perfectly. I then cut and pasted the autorespond line form http://www.tectite.com/fmhowto/autor...35044b06205374
    changing only the names of templates used - IT DOESN'T WORK!!! I as the one filling out the form did not get an auto response e-mail. My localhost does allow cookies.
    I've been coding computers of one sort or the other since 1979 - 99% of the time my errors are because I did something stupid like leaving out the HTMLTemplate is my first problem. All I did here was cut and paste and it DIDN'T work.

    Any help would be appreciated.

    Here is the code for the entire script:

    <html>
    <head>
    <title>Sample form for use with formmail.php</title>
    <script language="javascript" type="text/javascript">
    var nReload = 5;

    function NewVerifyImage() {
    if (nReload <= 2)
    if (nReload <= 0) {
    alert("Sorry, too many reloads.");
    return;
    }
    else
    alert("Only " + nReload + " more reloads are allowed");
    nReload--;

    //
    // This code now works in both IE and FireFox
    //
    var e_img;

    e_img = document.getElementById("vimg");
    if (e_img)
    //
    // FireFox attempts to "optimize" by not reloading
    // the image if the URL value doesn't actually change.
    // So, we make it change by adding a different
    // count parameter for each reload.
    //
    e_img.setAttribute("src",e_img.src+'?count='+nReload);
    }
    // -->
    </script>
    </head>
    <body>
    <p>This form demonstrates the use of formmail.php. <br />
    Note that formmail.php requires a one line change
    to work. Use a text editor to read the information
    at the top of formmail.php. </p>
    <p>Also, you need to change this form using a text editor;
    follow the 4 simple steps shown in the comments. </p>
    <p>We've included sample fields to show you how to
    submit Checkboxes, Radio Buttons, Multi-selection
    List Boxes, normail Text fields, and Text Areas. </p>
    <p> For full information and support, visit <a href="http://www.tectite.com/">www.tectite.com</a> </p>
    <p></p>
    <!-- STEP 1: Put the full URL to formmail.php on your website in the 'action' value. -->
    <form method="post" action="formmail.php" name="SampleForm">
    <input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER">
    <!-- STEP 2: Put your email address in the 'recipients' value. Note that you also have to allow this email address in the
    $TARGET_EMAIL setting within formmail.php!-->
    <input type="hidden" name="recipients" value="nms1944@yahoo.com" />
    <!-- STEP 3: Specify required fields in the 'required' value -->
    <input type="hidden" name="required" value="email:Your email address,realname:Your name" />
    <!-- STEP 4: Put your subject line in the 'subject' value. -->
    <input type="hidden" name="subject" value="Sample FormMail Testing" />
    <!-- Set up Bad Error handler & a template for it. -->
    <input type="hidden" name="bad_url" value="fmbadhandler.php" />
    <input type="hidden" name="bad_template" value="SampleErrorTemplate.htm" />
    <input type="hidden" name="this_form" value="http://localhost/Work/PHP/FormMail/SampleForm.html" />

    <input type="hidden" name="good_template" value="SampleGoodTemplate.htm" />
    <!--<input type="hidden" name="mail_options" value="PlainTemplate=Plain.txt,TemplateMissing=n/a,HTMLTemplate=SampleGoodTemplate2.htm" />-->
    <!--<input type="hidden" name="mail_options" value="PlainTemplate=Plain.txt,TemplateMissing=n/a" />-->
    <input type="hidden" name="mail_options" value="TemplateMissing=n/a,HTMLTemplate=SampleGoodTemplate2.htm" />
    <input type="hidden" name="autorespond" value="PlainTemplate=plain.txt,HTMLTemplate=AutoResponseTemplate.htm,Subject=Your confirmation,TemplateMissing=" />

    <table border="1" cellspacing="5%">
    <tr>
    <td><p>Please enter your name:</p></td>
    <td><input name="realname" type="text" size="50" maxlength="50" /> </td>
    </tr>
    <tr>
    <td><p>Please enter your email address:</p></td>
    <td><input name="email" type="text" size="50" maxlength="50" /> </td>
    </tr>
    <tr>
    <td><p>May we contact you?</p></td>
    <td> Yes
    <input type="radio" name="contact" value="Y" checked />
    No
    <input type="radio" name="contact" value="N" /> </td>
    </tr>
    <tr>
    <td><p>What are your favourite colours?</p></td>
    <td> Red
    <input type="checkbox" name="colors[]" value="red" />
    Blue
    <input type="checkbox" name="colors[]" value="blue" />
    Yellow
    <input type="checkbox" name="colors[]" value="yellow" /> </td>
    </tr>
    <tr>
    <td valign="top"><p>What vehicles do you have a license to operate?</p></td>
    <td valign="top"><select name="vehicles[]" multiple size="5">
    <option value="Car">Car</option>
    <option value="Bus">Bus</option>
    <option value="Truck">Truck</option>
    <option value="Plane">Aeroplane</option>
    <option value="Boat">Boat</option>
    </select>
    &nbsp;(Select all that apply; use CTRL-click to select) </td>
    </tr>
    <tr>
    <td valign="top"><p>Please enter your message:</p></td>
    <td><textarea name="mesg" rows="10" cols="60"></textarea> </td>
    </tr>
    <tr>
    <td>
    If you would like a confirmation email, please<br>enter the characters you see in the image:<br>
    <input type="text" size="12" name="arverify" />
    <img src="verifyimg.php" alt="Image verification" name="vimg" id="vimg" />
    </td>
    <td valign="top">
    If you cannot read the image, click for a new one&nbsp;
    <button onClick="NewVerifyImage(); return false;">New image</button>
    </td>
    </tr>
    <tr>
    <td><input name="submit" type="submit" value="Submit" /></td>
    <td></td>
    </tr>
    </table>
    </form>
    <!--
    Please support the ongoing development of FormMail and our other
    freeware products by keeping the following text on your form
    (or placing it elsewhere on your website). Thanks!
    -->
    <small>This form and its free <a href="http://www.tectite.com/">FormMail</a> processor supplied by www.tectite.com, creators of
    software <a href="http://www.tectite.com/">copy protection</a>. </small>
    </body>
    </html>

  7. #7
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Unable to get HTMLTemplate to work

    1. did u receive an alert from formmail telling you why the ar didnt work?
    2. try an email address away from ur domain

    mail servers are pains-in-the-posteriors nowadays

  8. #8
    Join Date
    May 2006
    Location
    Chicago
    Posts
    30

    Default Re: Unable to get HTMLTemplate to work

    The only thing that displayed was SampleGoodTemplate.htm - no error message.
    The e-mail recieved by the recipients was SampleGoodTemplate2.htm - no error message. So those parts worked.

    The recipient has an e-mail address of xxxxx@yahoo.com the e-mail address typed into the form is xxxxxx@comcast.net

  9. #9
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Unable to get HTMLTemplate to work

    so u got DEF_ALERT set, alerts work, and no alert was sent?

    if so it sounds like ur form isn't requesting an autoresp.

    formmail *always* tells u, via alerts, if something didnt work, but it wont tell u if u didnt ask it to do somthing

    wots the URL for the form?

  10. #10
    Join Date
    May 2006
    Location
    Chicago
    Posts
    30

    Default Re: Unable to get HTMLTemplate to work

    DEF_ALERT was not set. I set it to a third e-mail address and ran everything again The recipient was the only one that received an e-mail. The only thing the other two addresses have in common is that they both are at comcast.net.

    The URL to everything is http://neilswartz.com/FormMail/.

    I really appreciate your help in this.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Unable to create check file "/tmp/fm0ad2f6.txt"
    By nurblet in forum FormMail Subscription Support
    Replies: 1
    Last Post: 12-Jul-2005, 02:19 AM
  2. Unable to create check file ERROR
    By mdegan in forum FormMail Subscription Support
    Replies: 1
    Last Post: 12-May-2005, 11:57 PM
  3. Unable to create check file "/fm106c5c.txt" [M3]
    By gwbosma in forum FormMail Subscription Support
    Replies: 20
    Last Post: 16-Mar-2005, 10:23 PM
  4. unable to create check file
    By EPierre in forum FormMail Subscription Support
    Replies: 1
    Last Post: 12-Feb-2005, 08:23 PM
  5. Unable to relay
    By abonnell in forum FormMail Subscription Support
    Replies: 5
    Last Post: 15-Jan-2005, 06:31 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts