+ Reply to Thread
Results 1 to 8 of 8

Thread: Underscores in the email

  1. #1
    Join Date
    Mar 2012
    Posts
    21

    Default Underscores in the email

    Hi,
    Please be gentle, I am new to the forum and to php.
    I have downloaded the formmail from this site and added it to a html document that I had working with NMS formmail in the past. When these forms were sent via NMS the field names would be delivered with a space between the words ie. new or old but since changing to PHP they are coming through as new_or_used my client doesn't like this and they want to have the space back.
    How can I do this?

    Thanks
    Maggie

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

    Default Re: Underscores in the email

    HTML apparently lets u put spaces in field names. i'm not sure its legal HTML, tho.

    when PHP gets these, it replaces the spaces with _, so that the field names can be used within the php code as variable names.

    then formmail just lists these fields names with thei values in the email u get.

    the solution is to create a template, which also has the benefit of letting u format the email just the way u want.

    here's the how to guide: http://www.tectite.com/fmhowto/plaintmplt.php

    u can get fancier with HTML templates too.

  3. #3
    Join Date
    Mar 2012
    Posts
    21

    Default Re: Underscores in the email

    Hi Crabtree
    Thanks for your posting. I have tried to set up a basic html template fro the page link you have given me but I am obviously doing something wrong as it still comes through as before so I am assuming that it is not directing to the template.
    I am obviosly not doing this properly.
    Can I ask is says "Create a directory called "fmtemplates" at the top of your web server document root"
    Now is this the same as making a folder called "fmtemplates" and if so how do I get it at the top of the document root?
    Sorry for sounding "Thick"
    Maggie

  4. #4
    Join Date
    Mar 2012
    Posts
    21

    Default Re: Underscores in the email

    Hi Crabtree or anyone else that can help.
    I have tried to make a html template to work with the formmail.

    Following the instructions I have made a directory which i understand to be on my server at /home/nameremoved/public_html/fmtemplates
    nameremoved is actually the account name

    I have added that to my form mail $TEMPLATEDIR = "/home/removed/public_html/fmtemplates";

    I saved the template in the directory /home/removed/public_html/fmtemplates
    and added <input type="hidden" name="mail_options"value="HTMLTemplate=temp1" />
    to my html which the form is on see details below


    <form action="/fm26190AE6/formmail1.php" method="post" name="Florida Hills Availability Enquiry" target="_top" id="Florida Hills Availability Enquiry" onsubmit="MM_validateForm('email','','RisEmail','Rental Rate','','R','Dated','','R');return document.MM_returnValue">
    <input type="hidden" name="mail_options"value="HTMLTemplate=temp1" />
    <p align="center">
    <input type="hidden" name="recipients" value="removed" />
    <input
    type="hidden" value="Florida Hills Availability Enquiry" name="subject" />

    <input type="hidden" name="good_url"
    value="http://www.floridahills.co.uk/thankyou3.php" />
    <input type="hidden" name="derive_fields"
    value="imgverify=recaptcha_response_field,Date=%dom0%.%'-'%.%moy0%.%'-'%.%year%,Time=%time% " />
    <input type="hidden" name="alert_to"value="removed" />

    When I sumbit the form I get the mssage
    An error occurred while processing the form .

    Please contact us (www.floridahills.co.uk) directly since this form is not working .
    www.floridahills.co.uk apologizes for any inconvenience this error may have caused. and the page link as
    http://www.floridahills.co.uk/fm26190AE6/formmail1.php



    What am I doing wrong?
    Maggie

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

    Default Re: Underscores in the email

    #1 - always set DEF_ALERT in FormMail so it can email u detailed error messages

    #2:
    HTML Code:
    <input type="hidden" name="mail_options"value="HTMLTemplate=temp1" />
    is there really no space between " and value? that's wrong

    #3: temp1 isn't a good name, shouldn't it be temp1.htm since it is a template for an HTML document?

    #4: check u have the right folder by opening the template (temp1.htm) in ur browser.

  6. #6
    Join Date
    Mar 2012
    Posts
    21

    Default Re: Underscores in the email

    Hi Crabtree.
    I will look at those points tomorrow. With regards the DEF_ALERT I haven't received any mail so no clues there. I at least managed to get the plain text working at last
    Maggie

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

    Default Re: Underscores in the email


  8. #8
    Join Date
    Mar 2012
    Posts
    21

    Default Re: Underscores in the email

    Had problems with this setting and getting it to work.
    Just checked my mail boc and I got a @.SYNTAX-ERROR. sent on the 12th but nothing since.
    Have used the same email address for various forms so perhaps I need to go back and set a different email address on this one form I am trying to do the html test on and see if I can find out what the problem is.
    Thanks for your help so far much appreciated
    Maggie

+ 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. Lesson for the day: no underscores in recipients email addresses
    By worldmaker in forum HOWTO Guides and Tips
    Replies: 0
    Last Post: 09-Sep-2008, 09:13 AM
  2. Converting Underscores to Spaces from Form to E-mail
    By Kirk in forum FormMail Subscription Support
    Replies: 1
    Last Post: 01-Dec-2004, 07:20 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