Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Can't get html email to work

  1. #1
    Join Date
    May 2010
    Posts
    10

    Default Can't get html email to work

    I get text emails ok, but formmail doesn't see my html email template at all. It's called _template-form-to-email.html and sits in a folder called fmtemplates in the top level of the directory (along with index.html and the other pages). Testalert says "No input file specified."

    I've tried every combination I can think of:

    $TEMPLATEDIR = "http://sunsetlogisticsinc.com/fmtemplates/";
    $TEMPLATEDIR = "http://www.sunsetlogisticsinc.com/fmtemplates/";
    $TEMPLATEDIR = "../fmtemplates/";
    $TEMPLATEDIR = "fmtemplates/";
    $TEMPLATEDIR = "http://sunsetlogisticsinc.com/fmtemplates/_template-form-to-email.html";

    The example states:
    $TEMPLATEDIR = "/home/your-name/www/fmtemplates";
    but I don't where you get all those nested directories and how it applies.

    Been reading and searching the forum going on 2 hours now with all these programs and windows open - confused. help.
    Last edited by 150mph-orig; 29-May-2010 at 12:33 AM.

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

    Default Re: Can't get html email to work

    You need to run test alert to get the "server path" to your fmtemplates directory. Actually running test alert will give you the server path to your document root, then you can add on the rest of the path to fmtemplates from there.

    To run test alert, just put this in the browser address bar (substituting path-to-formmail.php with your own url, but with the question mark and testalert=1 on the end):

    http://www.sunsetlogistics.com/path-...hp?testalert=1

    A message should be sent to the email address defined in $DEF_ALERT. It will contain the server path to your document root.

  3. #3
    Join Date
    May 2010
    Posts
    10

    Default Re: Can't get html email to work

    After much frustration and time failing to get testalert messages, I fixed the problem and got my html email working - so I'm editing this message:

    I was unable to get testalert working - "dropped connections" error messages - and without it, I couldn't possibly get the path correct:

    /hsphere/local/home/c295122(notmyreal#)/mydomainname.com/fmtemplates

    I got tech support at my host to help.

    Another problem was that I'd put the hidden "mail options" field in my html email template, not in the form tags on my actual form page.

    Maybe someone can learn from my mistakes....

    Now to work out more of my Formmail problems....
    Last edited by 150mph-orig; 29-May-2010 at 08:38 PM.

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

    Default Re: Can't get html email to work

    It sounds like maybe your hosting account doesn't support PHP. Is that possible?

    Otherwise, are you sure that you edited in a plain text editor and uploaded formmail.php in ASCII mode?

    I can't think of any other reason that testalert wouldn't work.

    Also, are you on Unix or Windows hosting? Your host should be able to tell you the server path, or you might be able to get it from your control panel.

    Did you have the script working correctly before trying to use an HTML email template? You should always get the basic script working first.


    When submitting the form (http://sunsetlogisticsinc.com/_pickup.html) I get emails with text list. In the last line of the raw header of this email is:
    X-Php-Script: sunsetlogisticsinc.com/formmail/formmail.php

    Is this what you're saying is the server path to the doc root?
    No, I don't think so.

    Is it possible you could give me a sample or two of what my document root would look like? The samples on this forum just don't seem to apply....
    Well every person's will be different, but many Unix type hosting accounts are similar to the examples in the documentation and usually include your hosting username. If it's Windows hosting, then it could look something like:

    d:/path/to/templates

    Either way, this is info you'll have to get from your host if testalert doesn't work.

  5. #5
    Join Date
    May 2010
    Posts
    10

    Default Re: Can't get html email to work

    Thanks for trying to help me. Appreciate that. I'm just so relieved to have a very helpful tech at my hosting help me get it working. I got one of the forms sending html email using my html template correctly.

    Now, the second form, mostly the same fields as the first, sends me an html email with none of the fields filled in..

    I don't get it... can you help?

    Seems like the only thing I should have to change is which html template the form accesses. This one on the page http://sunsetlogisticsinc.com/_pickup.html works using this code:
    <input type="hidden" name="mail_options" value="HTMLTemplate=_template-email-pickup.htm"/>

    But this one, on the page http://sunsetlogisticsinc.com/_quote.html, using this code:
    <input type="hidden" name="mail_options" value="HTMLTemplate=_template-email-quote.htm"/> -- doesn't

    even though the "quote" template is simply a copy of the "pickup" template, renamed to the above name, with a few fields removed. Both live in the /fmtemplates folder in my top directory

    What else do I need to change?
    Last edited by 150mph-orig; 29-May-2010 at 08:59 PM.

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

    Default Re: Can't get html email to work

    You need to set TemplateMissing to either a text string or just a couple of single quotes so that if a non-required field isn't filled in, the template will use this value in empty fields, otherwise the template won't work.

  7. #7
    Join Date
    May 2010
    Posts
    10

    Default Re: Can't get html email to work

    Ok Ill try that. But I didn't create any required fields on the first form and it works correctly. I simply copied it and renamed it and now it doesn't as a second form.

    Are you saying if I have 2 separate forms accessing formmail.php, that I will have a problem unless I change the TemplateMissing line?

  8. #8
    Join Date
    May 2010
    Posts
    10

    Default Re: Can't get html email to work

    I can't see the reply i just posted -after refreshing numerous times - so i'm going to post again..


    Thanks for helping me Ginger. The first form has no required fields and works correctly to send me an html email. Are you saying when I use two different forms with formmail.php, that I need to change the TemplateMissing line?

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

    Default Re: Can't get html email to work

    No it has nothing to do with using multiple forms. If a form doesn't have every field filled in, and if you don't have TemplateMissing set, it won't work. The following page explains all of the possible form settings for formmail. Scroll down for TemplateMissing which is under mail_options:

    http://www.tectite.com/fmdoc/creating_forms.php

    You say that you copied the template, but if there are fields in the template that aren't sent with the form, there will be a problem.

    I'd have to take a look at your templates to see if there's any other problem like a field name misspelled or something.

  10. #10
    Join Date
    May 2010
    Posts
    10

    Red face Re: Can't get html email to work

    Thanks Ginger.

    I didn't do anything with a TemplateMissing line and the first form works correctly - returning an html email whether all fields are filled in or not. I don't understand what you're saying. That it shouldn't work correctly?

    It's only the duplicate of this correctly working form that doesn't work correctly.

    I think I solved the problem.. my fields weren't named correctly on the second form....
    But I don't understand about the TemplateMissing advice...
    Last edited by 150mph-orig; 29-May-2010 at 09:51 PM.

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
  •