ColdFusion contact form by email - please help

Hello,
I tried to create a contact form, using email to send, and I
have some issues and questions:
1. I like to have a message "Your form has been sent", but it
shows the blank after user submited the form.
2. If user enter her email address, this form will send to
her email address and me, but it does not send to her email
address.
Can anyone please take a look at my code below?
Why I don't get the output (result) I like to have?
Thanks very much.
Jenny.
<cfif IsDefined("form.Subject")>
<cfprocessingdirective suppresswhitespace="no">
<cfmail subject="#form.Subject#" from="#form.From#"
to="[email protected]" >
This is a message from that form...
#form.Message#
</cfmail>
</cfprocessingdirective>
<cfelse>
<cfform action="#CGI.SCRIPT_NAME#" method="post"
name="frmName">
name <cfinput type="text" name="Name" size="20"><br
/>
email <cfinput type="text" name="Email"
size="20"><br />
Subject <cfinput type="text" name="Subject"
size="20"><br />
Message <textarea name="Message" cols="30" rows="3"
></textarea><br />
<input type="submit" value="Submit it" />
</cfform>
<cfif isDefined("FORM.Name")>
<cfmail subject="#form.Subject#" from="#form.From#"
to="#Email#" >
</cfif>
<cfif isDefined("FORM.Submit")>
<p>Your message has been sent</p>
<cfelse>
<cflocation addtoken="no" url="survey2.cfm">
</cfif>

I always start my troubleshooting with
<cfdump var="#form#">
<cfabort>
You also have a problem with an cfmail tag without the
closing tag. I'm surprised that didn't cause a crash.
You also have some problems with your if/else logic.

Similar Messages

  • Contact form not working :( Please Help...

    Hey guys,
    I am really in trouble with flash forms and need help please. Ive been trying to get a contact form working for a few weeks but have had no luck.
    Below is the code I am putting in to the flash form and php file.
    (this is the code I have put for the send Button)
    on (release) {
             if (name eq "" or subject eq "" or message eq "" or email eq "") {
                   stop();
             } else {
             loadVariablesNum("form.php", 0, "POST");
             gotoAndStop(2);
    (this is the code I have put for the clear Button)
    on (release) {
        name = "";
        subject="";
        message="";
        email="";
    (And this is the php file i created in dreamweaver and saved it as form.php)
    $to = "[email protected]";
       $msg = "$name\n\n";
       $msg .= "$message\n\n";
      mail($to, $subject, $msg, "Message From: Online client\nReply-To: $email\n");
    ?>
    I have uploaded the swf file and php file on the server but my form is still not working by sending the information to my email.
    This is the link where i got the code from http://www.flashvault.net/tutorial.asp?ID=103
    It would be really greatful if someone could help me please
    I look forward to your opinions and ideas.
    Thanks

    you should really check a tutorial using loadvars.
    and there's no hope for that php file.:
    try:
    $to = "youremailaddress @ yourserver.com"; // change this to your email address
      $email=$_POST["email"];
       $msg = $_POST["name"]."\n\n";
       $msg .= $_POST["message"]."\n\n";
      mail($to, $subject, $msg, "Message From: Online client\nReply-To: $email\n");
    ?>

  • I forgot my apple password  and i forgot the security q , and i think somebody hacks my email . please help

    i forgot my apple password  and i forgot the security q , and i think somebody hacks my email . please help!!!
    this is it ([email protected])

    Locked Out, Forgot Lock or Restrictions Passcode, or Need to Restore Your Device: Several Alternative Solutions
    A
    1. iOS- Forgotten passcode or device disabled after entering wrong passcode
    2. iPhone, iPad, iPod touch: Wrong passcode results in red disabled screen
    3. Restoring iPod touch after forgotten passcode
    4. What to Do If You've Forgotten Your iPhone's Passcode
    5. iOS- Understanding passcodes
    6. iTunes 10 for Mac- Update and restore software on iPod, iPhone, or iPad
    7. iOS - Unable to update or restore
    Forgotten Restrictions Passcode Help
                iPad,iPod,iPod Touch Recovery Mode
    You will need to restore your device as New to remove a Restrictions passcode. Go through the normal process to restore your device, but when you see the options to restore as New or from a backup, be sure to choose New.
    You can restore from a backup if you have one from BEFORE you set the restrictions passcode.
    Also, see iTunes- Restoring iOS software.
    Alternatives for Help Resetting Security Questions and Rescue Mail
         1. Apple ID- All about Apple ID security questions.
         2. Rescue email address and how to reset Apple ID security questions
         3. Apple ID- Contacting Apple for help with Apple ID account security.
         4. Fill out and submit this form. Select the topic, Account Security.
         5.  Call Apple Customer Service: Contacting Apple for support in your
              country and ask to speak to Account Security.
    How to Manage your Apple ID: Manage My Apple ID

  • Adobe muse CC contact form not emailing correctly

    the adobe muse contact form not emailing to address in form. it's correct within form, link in Muse, and the address is correct within web hosting files. please advise. thx

    Responded to your other thread - http://forums.adobe.com/message/5555450#5555450.
    Thanks,
    Vinayak

  • HT5312 Im not receive resend mail at my rescue email .please help me

    Im not receive resend mail at my rescue email .please help me

    If you aren't receiving the email to your rescue email account (and you've tried clicking the reset link again) then you will need to contact Support in your country to get the questions reset.
    Contacting Apple about account security : http://support.apple.com/kb/HT5699

  • My mac has started displaying a message stating "You need to restart your computer".  Web says it's kind of kernel panic! Is this a hardware problem? Do i need to contact my distributor? please help..it annoys me very much..

    My mac has started displaying a message stating "You need to restart your computer".  Web says it's kind of kernel panic! Is this a hardware problem? Do i need to contact my distributor? please help..it annoys me very much..

    Hello welcome to the ASC user to user forums
    please see these support documents
    http://support.apple.com/kb/TS2570
    http://support.apple.com/kb/TS1440
    http://support.apple.com/kb/HT1455
    http://support.apple.com/kb/ht3964
    http://support.apple.com/kb/HT1379
    http://support.apple.com/kb/ht1379
    http://support.apple.com/kb/HT1509

  • Could a community host contact me by email please?

    Could a community host contact me by email please?
    This is a genuine request for apple community support, not the start of a conversation thread.

    But how did you know where Rebecca lived to quote PDT time.   It says 09.18 on my version of her post. 
    There's a secret somewhere ... you don't earn all those points without being in on it. 
    Thanks for the tip, all the same.

  • HT201210 cont contact apple server error please help with ipad touch 4. im just fed up with apple please help me because why is it only apple with these kind of problems?

    cont contact apple server error please help with ipad touch 4. im just fed up with apple please help me because why is it only apple with these kind of problems?

    If you mean updae server
    Update Server
    Try:
    - Powering off and then back on your router.
    - iTunes for Windows: iTunes cannot contact the iPhone, iPad, or iPod software update server
    - Change the DNS to either Google's or Open DNS servers
    Public DNS — Google Developers
    OpenDNS IP Addresses
    - For one user uninstalling/reinstalling iTunes resolved the problem
    - Try on another computer/network
    - Wait if it is an Apple problem
    Otherwise what server are you talking about

  • I cant buy any gem on Clash of Clan , It ash me to contact iTunes Support .. please help me

    i cant buy any gem on Clash of Clan , It ash me to contact iTunes Support .. please help me

    Do what it told you to do.
    Contact itunes support

  • HT5577 I lost my Apple ID,icloud,pass and my email,please help ! thank !

    I lost my Apple ID,icloud,pass and my email,please help ! thank !

    I also got this email and had my phone "automatically" removed. But luckily I set up a extra mobile number as a trust device. You should also have a generated backup key saved somewhere?

  • HT204150 I accidentally deleted all my contacts in the Cloud, please help restore!

    I accidentally deleted all my contacts in the Cloud, please help restore!

    Tap Settings > iCloud
    Switch Contacts off then back on.
    If that doesn't help, try here >  iCloud: Restore your iOS device from iCloud

  • Urgent help - MUSE email form not working - PLEASE HELP

    HI to all!!
    I'm having a big issue here with Adobe Muse cc 7.0
    I have my personal domain www.shepherdtextiles.com
    and third party host (here in China which is 72e.net (and yes, got all php and so on requirements Adobe Muse needs)
    I follow carefully all steps to add a simple contact form, adding first [email protected] and changing it to my personal hotmail when I saw it wasn't working to try if with hotmail could work, but didn't.
    I have checked the Muse PHP Diagnostics  and as you can see the mail one failed.....
    I used first the simple contact form that comes with Muse and later I used one from museresources.com but none of them seemed to work
    I'm just guessing that something is not well setup on my server because I just follow all steps Adobe mentioned and I watched many videos where people do it very simple.
    The error I get on my website when I click on submit button is "The server encountered an error"
    There is NO error when I export to html or warnings, just exports fine.
    PLEASE HELP
    Many many thanks!
    Vic

    I'M having a similar problem with my Muse website Formally hosted by GoDaddy. The contact me widget does not send an email when you click submit button. Normally, it accepts with a green check mark in another screen. It does not do that. The submit just turns black when clicked, but nothing else happens
    THe he regular email works. I am able to send and receive. It just does not work with the contact widget

  • My iphone wouldnt stop restarting so i backed it up and restored it but when i did i had NOTHING on my phone i lost all my contacts my 1,700 photos my texts, emails please help me i have a time machine, will that work?

    I restarted my iphone after it wouldnt stop restarting every 5 seconds so i plugged it into i tunes backed it up and restored it but when i did my phone had no data and that back up i made is gone... is there anyway i can get this back please eveything is gone, 1,700 photos 500 contacts all my emails and texts. i have a Time Machine can i restore itunes that way and have it?

    I suggest plugging your iPhone into a wall socket, and letting it sit for many hours (while connected to WiFi).

  • Contact Form with Email PHP not working?

    Hello !
    Here is a link to my contact form:
    http://bayareafacepainters.com/quote_face_painting.html
    Here is the tutorial I am following to set up the Form to Email PHP
    http://www.freecontactform.com/email_form.php
    My form is not working. It is not sending me the email, and the "Thank you for contacting us page" is not showing up either. Is this a simple fix? I am not an expert coder, any help on what I am doing wrong or missing would be helpfull!

    Thank you for the suggestions... I cleaned up the names, and so I guess I am supposed to match the names in the form  to the PHP, so I changed the PHP to reflect the names of the fields in the form... it seems there may be more areas where I need to do this... What else does this need to work properly?
    http://www.bayareafacepainters.com/quote_face_painting.html
    <?php
    if(isset($_POST['email'])) {
        // EDIT THE 2 LINES BELOW AS REQUIRED
        $email_to = "[email protected]";
        $email_subject = "Face Painting Quote";
        function died($error) {
            // your error code can go here
            echo "We are very sorry, but there were error(s) found with the form you submitted. ";
            echo "These errors appear below.<br /><br />";
            echo $error."<br /><br />";
            echo "Please go back and fix these errors.<br /><br />";
            die();
        // validation expected data exists
        if(!isset($_POST['Name']) ||
            !isset($_POST['Email']) ||
            !isset($_POST['Phone']) ||
            !isset($_POST['Contact_Preference']) ||
            !isset($_POST['Contact_Preference']) ||
            !isset($_POST['Date']) ||
            !isset($_POST['Time']) ||
            !isset($_POST['Location']) ||
            !isset($_POST['Guests']) ||
            !isset($_POST['Age']) ||
            !isset($_POST['comments'])) {
            died('We are sorry, but there appears to be a problem with the form you submitted.');     
        $Name = $_POST['Name']; // required
        $Email = $_POST['Email']; // required
        $Phone = $_POST['Phone']; // required
        $telephone = $_POST['telephone']; // not required
        $comments = $_POST['comments']; // required
        $error_message = "";
        $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
      if(!preg_match($email_exp,$email_from)) {
        $error_message .= 'The Email Address you entered does not appear to be valid.<br />';
        $string_exp = "/^[A-Za-z .'-]+$/";
      if(!preg_match($string_exp,$first_name)) {
        $error_message .= 'The First Name you entered does not appear to be valid.<br />';
      if(!preg_match($string_exp,$last_name)) {
        $error_message .= 'The Last Name you entered does not appear to be valid.<br />';
      if(strlen($comments) < 2) {
        $error_message .= 'The Comments you entered do not appear to be valid.<br />';
      if(strlen($error_message) > 0) {
        died($error_message);
        $email_message = "Form details below.\n\n";
        function clean_string($string) {
          $bad = array("content-type","bcc:","to:","cc:","href");
          return str_replace($bad,"",$string);
        $email_message .= "First Name: ".clean_string($first_name)."\n";
        $email_message .= "Last Name: ".clean_string($last_name)."\n";
        $email_message .= "Email: ".clean_string($email_from)."\n";
        $email_message .= "Telephone: ".clean_string($telephone)."\n";
        $email_message .= "Comments: ".clean_string($comments)."\n";
    // create email headers
    $headers = 'From: '.$email_from."\r\n".
    'Reply-To: '.$email_from."\r\n" .
    'X-Mailer: PHP/' . phpversion();
    @mail($email_to, $email_subject, $email_message, $headers);
    ?>
    <!-- include your own success html here -->
    Thank you for contacting us. We will be in touch with you very soon.
    <?php
    ?>

  • Hi all, im a newbie and in need of help on contact form if anybody could help

    hi everybody, im new to the site and relatively new to dreamweaver.
    i have used a template for my website and edited all the relative information to tailor it to my business. 
    As i am not familiar with the contact forms i am struggling to find out how to make the form send the information to my email address as i have not got a clue if the contact form is coded correctly,
    i  would much appreciate any assistence given by any of you, as i am desperately in need of your expertice
    i have copied what is in the code for the form, i was wondering if anybody could tell me if this code can be used or not
    thank you very much,
    Steven

    HTML forms don't do anything.  You need a form-to-email processing script -- preferably one which conceals your e-mail address from harvesters and has built-in spam prevention.
    Contact your web host and ask them if they have a script you can use.  Hosts often provide scripts on their servers which you can activate through your Admin Panel or by directly referencing the script in your form's action attribute.
         <form action="path-to-form-on-server/form-to-email-script.php">
    If your host doesn't provide scripts, ask them which server-side languages you can use (php, asp, asp.net, perl, coldfusion, etc...) so you can find a suitable script to use.
    Related Links:
        Formm@ailer PHP script from DB Masters
        http://dbmasters.net/index.php?id=4
        FormToEmail.com (free & pro PHP scripts)
        http://formtoemail.com/formtoemail_pro_version.php    
        Tectite
        http://www.tectite.com/formmailpage.php
        Forms to Go from Bebosoft (script generating software)
        http://www.bebosoft.com/products/formstogo/overview/
        Wufoo.com (on-line form service)
       http://wufoo.com/
    Nancy O.

Maybe you are looking for