Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: Problems getting HTML email template to excute

  1. #1
    Join Date
    Dec 2008
    Posts
    31

    Default Problems getting HTML email template to excute

    Hi

    Finally got my forms all working the way I want them and have now tried to get the HTML email template to work. Looks easy enough compared to setting up the rest of it, but unfortunately I'm getting an error message I've never received before.

    Code:
    Failed to send email
    This is the form that doesn't work. You have to fill out all fields though and then you will get the error message:

    http://www.oceaneye.com.au/contact2.htm

    This is the code i added that has since made it not work:

    Code:
    <input type="hidden" name="mail_options" value="HTMLTemplate=email_template.htm" />
    This is the page working before i added the code.

    http://www.oceaneye.com.au/contact.htm

    This is my email_template:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Ocean Eye - Surf photography, Northern Beaches Sydney, surf report</title>
    <meta name="keywords" content="Surf photography, Northern Beaches Sydney, surf report, surfing, Australian Surf, hire a surf photographer, bodyboarding, ocean, big waves, coastalwatch, realsurf, swellnet, ASL, Riptide">
    <meta name="Description" content="Your eye in and out of the water on the Northern Beaches of Sydney, Australia">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link rel="stylesheet" type="text/css" href="../stylesheets/css_main.css"/>
    </head>
    <body>
    <p><img src="../images/logo.gif" alt="Oceaneye Photography" width="358" height="38"> 
    </p>
    <h5>FORM RESULTS FROM OCEANEYE.COM.AU<br>
    </h5>
    <table width="552" border="0">
      <tr> 
        <td width="103" height="25">
    <div align="left">First name:</div></td>
        <td width="433"><div align="left"><b>$realname</b></div></td>
      </tr>
      <tr> 
        <td height="28">
    <div align="left">Last name:</div></td>
        <td><div align="left"><b>$lastname</b></div></td>
      </tr>
      <tr> 
        <td height="30">
    <div align="left">Country:</div></td>
        <td><div align="left"><b>$country</b></div></td>
      </tr>
      <tr> 
        <td height="29">
    <div align="left">Phone Number:</div></td>
        <td><div align="left"><b>$phone</b></div></td>
      </tr>
      <tr> 
        <td height="27">
    <div align="left">Email address:</div></td>
        <td><div align="left"><b>$email</b></div></td>
      </tr>
      <tr> 
        <td height="26">
    <div align="left">Slideshow #:</div></td>
        <td><div align="left"><b>$slideshow</b></div></td>
      </tr>
      <tr> 
        <td height="29">
    <div align="left">Photo #'s:</div></td>
        <td><div align="left"><b>$photonumbers</b></div></td>
      </tr>
      <tr> 
        <td height="83"> 
          <div align="left">Questions:</div></td>
        <td><div align="left"><b>$comments</b></div></td>
      </tr>
    </table>
    </body>
    </html>
    Thanks for your time!

  2. #2
    Join Date
    May 2008
    Posts
    1,291

    Default Re: Problems getting HTML email template to excute

    So you have been receiving form result emails before (not error messages) to the address specified in recipients? If so, then maybe your $TEMPLATEDIR setting isn't right.

    Also, you should remove the space between your <textarea> </textarea> tags. Your javascript validation isn't catching the empty field because there's a space there, but formmail should catch it, and HTML templates won't work unless all fields are either "required" (so no fields can be empty) or you add the TemplateMissing parameter to your mail_options tag which tells the script what to put in case there's an empty field.

    ginger

  3. #3
    Join Date
    Dec 2008
    Posts
    31

    Default Re: Problems getting HTML email template to excute

    Hi Ginger

    $TEMPLATEDIR is correct I should think as I have been receiving submitted correct emails no problem.

    formmail.php code

    Code:
    $TEMPLATEDIR = "/http://www.oceaneye.com.au/formresults/";
    Question about this:

    you should remove the space between your <textarea> </textarea>
    Which text area tags are you specifically talking about? In the email template? or elsewhere in my contact page codes that you may have looked at?

    I added this

    Code:
     <input type="hidden" name="mail_options" value="HTMLTemplate=email_template.htm,TemplateMissing=N/A"/>
    but do I really need this if I have a 'required' tag?

    Here's my contactpage2 form code:

    Code:
      <form method="post" action="http://www.oceaneye.com.au/formmail/formmail.php" name="Contact">
        <input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER">
        <input type="hidden" name="recipients" value="oceaneye"/>
        <input type="hidden" name="required" value="realname:- FIRST NAME: Your first name,lastname:- LAST NAME: Your last name,country:- COUNTRY: Where you are currently working or living,email:- EMAIL: Your email address,phone:- PHONE: Type NO if you do not want us to contact you by phone,questions:- QUESTIONS: Your question that you have for us,imgverify:- IMAGE VERIFY: The text shown in the image" />
        <input type="hidden" name="subject" value="Oceaneye.com.au contact page"/>
        <input type="hidden" name="good_url" value="../formresults/goodsub.htm"/>
        <input type="hidden" name="bad_url" value="../formmail/fmbadhandler.php"/>
     <input type="hidden" name="bad_template" value="badsub.htm"/> 
     <input type="hidden" name="mail_options" value="HTMLTemplate=email_template.htm,TemplateMissing=N/A"/>
    Thanks for your time Ginger

  4. #4
    Join Date
    May 2008
    Posts
    1,291

    Default Re: Problems getting HTML email template to excute

    Your $TEMPLATEDIR setting isn't right. Search the forum and you'll find plenty of instruction on how to get your $TEMPLATEDIR setting, which is a "file system path".

    Another option is to set $TEMPLATEURL (which would be basically what you currently have for $TEMPLATEDIR, except without the trailing slash.)

    You don't need both though.

    ginger

  5. #5
    Join Date
    May 2008
    Posts
    1,291

    Default Re: Problems getting HTML email template to excute

    Quote Originally Posted by brazmus View Post
    Question about this:

    Which text area tags are you specifically talking about?
    What you referred to as a multi-line text field ... in your contact form. I think the field is for "questions".

    Quote Originally Posted by brazmus View Post
    I added this

    Code:
     <input type="hidden" name="mail_options" value="HTMLTemplate=email_template.htm,TemplateMissing=N/A"/>
    but do I really need this if I have a 'required' tag?
    No, you don't as long as all fields are required.

    ginger

  6. #6
    Join Date
    Dec 2008
    Posts
    31

    Default Re: Problems getting HTML email template to excute

    Thanks for fixing the <textarea> question for me! I've been wondering about that for a looong time! You confused me a bit as it was a question I asked in a seperate thread. Have answered that thread now with what you have told me here.

    With regards to this issue:

    Your $TEMPLATEDIR setting isn't right. Search the forum and you'll find plenty of instruction on how to get your $TEMPLATEDIR setting, which is a "file system path".

    Another option is to set $TEMPLATEURL (which would be basically what you currently have for $TEMPLATEDIR, except without the trailing slash.)

    You don't need both though.

    ginger
    If my setting isn't right, how come all the other templates I have in there work? ie: FORM ERROR which appears when you click submit on this page is within this template folder.

    http://www.oceaneye.com.au/contact2.htm


    Can you please suggest what I change TEMPLATEURL and TEMPLATEDIR too exactly? Also are you referring to changing it within formmail.php or fmbadhandler.php or both? I've searched the forum, have made changes but have not had luck so far with what I have done.

    Thanks again

  7. #7
    Join Date
    May 2008
    Posts
    1,291

    Default Re: Problems getting HTML email template to excute

    If the folder where you store your templates is called "formresults" and it's located in the root then this is what you should put for $TEMPLATEURL:

    Code:
    $TEMPLATEURL = "http://www.oceaneye.com.au/formresults";
    To get the right setting for $TEMPLATEDIR, you need to get the path to your document root by running test alert:
    http://www.oceaneye.com.au/formmail/...hp?testalert=1

    Then you need to add "/formresults" to the path shown for DOCUMENT_ROOT.

    You need to edit both scripts, formmail.php and fmbadhandler.php

    ginger

  8. #8
    Join Date
    Dec 2008
    Posts
    31

    Default Re: Problems getting HTML email template to excute

    Bugger. Still no go.

    I did as you said in both php forms.

    Code:
    $TEMPLATEDIR = "/hsphere/local/home/oceaneye/oceaneye.com.au/formresults";
    and

    Code:
    $TEMPLATEURL = "http://www.oceaneye.com.au/formresults";
    Here's my current contact page code:

    Code:
      <form method="post" action="http://www.oceaneye.com.au/formmail/formmail.php" name="Contact">
        <input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER">
        <input type="hidden" name="recipients" value="oceaneye"/>
        <input type="hidden" name="required" value="realname:- FIRST NAME: Your first name,lastname:- LAST NAME: Your last name,country:- COUNTRY: Where you are currently working or living,email:- EMAIL: Your email address,phone:- PHONE: Type NO if you do not want us to contact you by phone,questions:- QUESTIONS: Your question that you have for us,imgverify:- IMAGE VERIFY: The text shown in the image" />
        <input type="hidden" name="subject" value="Oceaneye.com.au contact page"/>
        <input type="hidden" name="good_url" value="../formresults/goodsub.htm"/>
        <input type="hidden" name="bad_url" value="../formmail/fmbadhandler.php"/>
     <input type="hidden" name="bad_template" value="badsub.htm"/> 
     <input type="hidden" name="mail_options" value="HTMLTemplate=email_template.htm"/>
    Once I've got this down, I've finished the site! Can't wait. Thanks for your help thus far.

  9. #9
    Join Date
    May 2008
    Posts
    1,291

    Default Re: Problems getting HTML email template to excute

    You don't need both, just one or the other. First, try removing everything from $TEMPLATEDIR, and keeping what you have for $TEMPLATEURL since we know that's accurate.

  10. #10
    Join Date
    May 2008
    Posts
    1,291

    Default Re: Problems getting HTML email template to excute

    What do you have for $TARGET_URLS?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Sending form results in an HTML email
    By russellr in forum HOWTO Guides and Tips
    Replies: 26
    Last Post: 12-Jan-2006, 08:31 PM
  2. HTML Email not working
    By Rich in forum FormMail Subscription Support
    Replies: 9
    Last Post: 23-Jul-2004, 09:11 PM
  3. Can I Include an Image in an HTML Email??
    By minskin in forum FormMail Subscription Support
    Replies: 4
    Last Post: 19-Jun-2004, 02:43 PM
  4. HTML email reply
    By aussieincanada in forum FormMail Subscription Support
    Replies: 5
    Last Post: 04-Jun-2004, 06:07 AM
  5. send an email in HTML
    By michecosta in forum FormMail Subscription Support
    Replies: 3
    Last Post: 25-May-2004, 08:18 PM

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
  •