We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14542
    • 13 Posts
    Hi,

    I’ve been trying to get FormIt working for the past week or so. I have trawled the web looking for various guides, and using modx’s documentation as well and Modx’s Forums.

    I’m running Modx Revolution 2.0.2 pl

    Server Info

    Linux 5.3.2

    MySQL version 5.0.91-community
    Apache version 2.2.15
    PHP version 5.3.2

    Browsers:

    Firefox 3.6.8
    Safari 5.0

    I have checked that the mail() is switched on, I used a simple php mail function I found on the Modx forums. So I was able to receive mail from that function but no the FormIt function.

    I currently have the code for the form sitting in my page template.
      • 14542
      • 13 Posts
      Below is the code used in my template

      [[!FormIt?
      &hooks=`email`
      &emailTpl=`FormEmail`
      &emailSubject=`[[+subject]]`
      &emailTo=`[email protected]`
      &emailToName=`Creme Fresh`
      &emailFrom=`[[+email]]`
      &emailFromName=`[[+name]]`
      &emailReplyTo=`[[+email]]`
      &emailReplyToName=`[[+name]]`
      &redirectTo=`10`
      ]]
      
      
      
      
      <p>[[+fi.error.error_message]]</p>
      <br />
      
      <form class="form" action="[[~[[*id]]]]" method="post"> 
          <input name="nospam:blank" type="hidden" />
      
      <label for="name"> 
           Name: <span class="error">[[+fi.error.name]]</span> 
      </label> 
        <br /><input id="name" cols="45" name="name:required" type="text" value="[[+fi.name]]" /><br />
      
      <label for="email"> 
           Email: <span class="error">[[+fi.error.email]]</span> 
      </label> 
        <br /><input id="email" cols="45" name="email:email:required" type="text" value="[[+fi.email]]" /><br /> 
      
      <label for="phone"> 
           Phone: <span class="error">[[+fi.error.phone]]</span> 
      </label> 
        <br /><input id="phone" cols="45" name="phone:isNumber:required" type="text" value="[[+fi.phone]]" /><br /> 
      
      <label for="subject"> 
          Subject: <span class="error">[[+fi.error.subject]]</span> 
      </label> 
        <br /><input id="subject" cols="45" name="subject:required" type="text" value="[[+fi.subject]]" /><br />
      
      <label for="text"> 
          Message: <span class="error">[[+fi.error.text]]</span> 
      </label> 
          <br /><textarea id="text" cols="45" rows="7" name="text:required:stripTags">[[+fi.text]]</textarea> 
       <br class="clear" />
      <!--[[!+formit.recaptcha_html]] 
      [[+fi.error.recaptcha]]   -->
       <br class="clear" />
      
      <div class="form-buttons"> 
          <button class="button" type="submit" value="Send" >Submit</button>
      </div>
      </form>
      
        • 17552
        • 46 Posts
        Try this...

        <label for="emailX">
             Email: <span class="error">[[+fi.error.emailX]]</span> 
        </label> 
          <br /><input id="emailX" cols="45" name="emailX:email:required" type="text" value="[[+fi.emailX]]" /><br /> 
        


        Kersten
          • 14542
          • 13 Posts
          Hi Kersten,

          It didn’t work, so back to the drawing board. Does my hosting environment need any particular settings in order for Formit to work?

          John
            • 17552
            • 46 Posts
            Hi John,

            I had the same problem like you. After turning on and off some setting, it works. I don’t know why. I would have been surprised if my suggestion really works for you...but this was one of the setting I changed...

            It seems that the whole FormIt is really buggy or parts of modx are so. After getting the mail sent, I have know problems with the redirection. It’s just a pity that no one of the developers give a hint...

            Kersten
              • 3749
              • 24,544 Posts
              If all you need is a simple contact form, you could try SPForm, which generally works right out of the box if mail() is turned on.

              Otherwise, the best way to get FormIt to work is to follow this tutorial exactly:

              http://rtfm.modx.com/display/ADDON/FormIt.Example+1+-+Contact+Page

              Then, once it’s working, modify it to meet your needs.
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 7966
                • 90 Posts
                I have the same problem, no emails are sent.

                I used the exact formit example by copying and pasting and was getting the following "An error occurred while trying to send the email" as mentioned here - http://modxcms.com/forums/index.php/topic,54494.0.html

                When I cleared the carriage returns from the example today, no error occurs, and contact form is redirected to another page now, but still no email is sent.

                I have tested the php mail function with the test code provided on another thread. Mail is sent without any problem

                <?php
                $to = "[email protected]";
                $subject = "Test mail";
                $message = "Hello! This is a simple email message.";
                $from = "[email protected]";
                $headers = "From: " .  $from;
                mail($to,$subject,$message,$headers);
                return "Attempted Mail Send.";
                ?>



                Any hints what else could we check?
                  • 3749
                  • 24,544 Posts
                  I’m afraid I’m no help here because I always use the SMTP system settings and send through Gmail. You could try that.
                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting
                    • 7966
                    • 90 Posts
                    Thanks BobRay.

                    Anyway I made the gmail work by clearing the carriage returns. But no lock with server mail function yet.
                      • 3749
                      • 24,544 Posts
                      Quote from: dragona at Oct 08, 2010, 05:31 AM

                      Thanks BobRay.

                      Anyway I made the gmail work by clearing the carriage returns. But no lock with server mail function yet.

                      Glad you got something working. That suggests that your code is all OK now, so you may be dealing with a bug in FormIt.

                      Hopefully, someone else with a server that has mail() enabled will check.

                        Did I help you? Buy me a beer
                        Get my Book: MODX:The Official Guide
                        MODX info for everyone: http://bobsguides.com/modx.html
                        My MODX Extras
                        Bob's Guides is now hosted at A2 MODX Hosting