We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42689
    • 125 Posts
    Hello user's

    i have used formit in my contact page for my website,i have follow all instructions of formit but still its not working ..

    i have downlaode the package first and install it..

    after that i have creat a page and add code into
    [[!FormIt?
       &hooks=`recaptcha,spam,email,redirect`
       &emailTpl=`MyEmailChunk`
       &emailTo=`[email protected]`
       &redirectTo=`123`
       &validate=`name:required,
          email:email:required,
          subject:required`
    ]]
    
    
    [[!+fi.error_message:notempty=`<p>[[!+fi.error_message]]</p>`]]
    <form action="[[~[[*id]]]]" method="post" class="form">
    <input type="hidden" name="nospam:blank" value="" />
    		<input type="text" name="name" id="name" class="input_field" value="[[!+fi.name:default=`Name:`]]" />
            <span class="error">[[!+fi.error.name]]</span>
    
    			<input type="text" name="email" id="email:" value="[[!+fi.email:default=`Email:`]]"  class="input_field"/>
    			<span class="error">[[!+fi.error.email]]</span>
    		
              <input type="text" name="subject" id="subject" value="[[!+fi.subject:default=`Subject:`]]" class="input_field" />
    			<span class="error">[[!+fi.error.subject]]</span>
    	
              <textarea name="notes">[[!+fi.notes:default=`Message:`]]</textarea>
         
            <input type="submit" value="Submit" class="blue_btn_small" />
    </form>
    


    after taht i have creat a new chunk with the name of "MyEmailChunk".. and add code into it
    This is the Formit Email Chunk.
     
    <br />[[+name]] ([[+email]]) Wrote: <br />
     
    [[+text]]
    


    after that i have run my page .. validation's are working bt after fill all field's the form did nt redirect or also did nt send the email..

    plz help smiley
      • 16348
      • 64 Posts
      Are you planning to use recaptcha? In that case your are missing the recaptcha specific placeholders in your form. See this page http://rtfm.modx.com/display/ADDON/FormIt.Hooks.recaptcha.
      If you don't want recaptcha, remove that from the hook list and see if it makes any difference.

      Have you configured the email system in your site config?
        • 42689
        • 125 Posts
        Hello,thanx for the reply..

        [[!FormIt?
           &hooks=`spam,email,redirect`
           &emailTpl=`MyEmailChunk`
           &emailTo=`[email protected]`
           &redirectTo=`123`
           &validate=`name:required,
              email:email:required,
              subject:required`
        ]]


        no i did nt want recaptcha,so i have remove recaptcha from the hook

        after that when i submit the form its showing that error

        An error occurred while trying to send the email. Could not instantiate mail function.


        and soory i did nt understand what u want to say Have you configured the email system in your site config? ..?

        plz tell me in details

        Thanxx smiley
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          By default, MODx tries to use the PHP mail() function. That error means that your web server doesn't allow the mail() function to be used. You will need to set up MODx to use an external SMTP mail server. This is done in the System Settings. Your hosting control panel should have an email account manager, and it will tell you what settings are needed to use SMTP. You will need the name of the SMTP server (perhaps like smtp.mydomain.com or mail.mydomain.com), then your email account's user name ([email protected]) and its password.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 42689
            • 125 Posts
            its working now .. bt there are one problem
            [[!FormIt?
               &hooks=`spam,email,redirect`
               &emailTpl=`MyEmailChunk`
               &emailTo=`[email protected]`
               &redirectTo=`123`
               &validate=`name:required,
                  email:email:required,
                  subject:required`
            ]]


            i have used "[email protected]" in "emailTo" .. right ..?

            i my contact form have 3 text box

            NAME|EMAIL|SUBJECT ..

            if i have enter my email id "[email protected]" in Email text box then its working fine .. but if i fill some one another email id then its show
            An error occurred while trying to send the email. Could not instantiate mail function.


            plzz help smiley
              • 42689
              • 125 Posts
              Thanx sottwell for your reply ..

              if there are really problem related my email account manager,then if i have enter the "[email protected]" in my email field then why my mail was sent correctly ..??

              Thanxx smiley
                • 3109 ☆ A M B ☆
                • 894 Posts
                @chirag install QuickEmail to check if you can send emails from your site that way we know for sure its a server issue or a MODX issue.

                Also are you testing this locally or on a server?

                If locally it won't work.
                  Benjamin Marte
                  Interactive Media Developer
                  Follow Me on Twitter | Visit my site | Learn MODX
                  • 42689
                  • 125 Posts
                  Thanx benmarte for your reply .. i am testing on a server not at local ..

                  and i have also found my solution..

                  What's the issue ..? when i have enter "[email protected]" in my email field .. then at time its show error.

                  An error occurred while trying to send the email. Could not instantiate mail function.


                  And if i m enter [email protected] then its working fine smiley

                  Thanxx smiley
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    Sounds like some kind of server-based mail setting disallowing sending to itself.
                      Studying MODX in the desert - http://sottwell.com
                      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                      Join the Slack Community - http://modx.org