We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28042 ☆ A M B ☆
    • 24,524 Posts
    Problem:
    Mail is sent, all values are correct. Form behaves properly if input is invalid. But instead of the "thank you" chunk being displayed, the "Could not instantiate mail function." error is displayed.

    eform: 1.4.3 (upgraded from 1.4.1, which was doing the same thing)
    MODx: 0.9.5 RC3 rev 2051 (upgraded to 0.9.5 final rev 2106)
    PHP: 4.4.2 CGI
    Apache (dunno which version, it’s not reporting itself)
    FreeBSD

    Debug output:
    eForm configuration:
    
    array (
      'snipPath' => '/home/xxxx/public_html/assets/snippets/',
      'vericode' => '1',
      'formid' => 'commentsForm',
      'from' => '[email protected]',
      'fromname' => 'CMS Site',
      'to' => '[email protected]',
      'cc' => '',
      'bcc' => '',
      'subject' => 'Web Enquiry',
      'ccsender' => 0,
      'sendirect' => 0,
      'mselector' => 0,
      'mobile' => '',
      'mobiletext' => '',
      'autosender' => NULL,
      'autotext' => '',
      'category' => 0,
      'keywords' => '',
      'gid' => 84,
      'noemail' => false,
      'saveform' => true,
      'tpl' => 'commentsForm',
      'report' => 'EmailForm',
      'allowhtml' => 0,
      'replyto' => 'emailaddress',
      'language' => 'english',
      'thankyou' => 'commentsSent',
      'isDebug' => '1',
      'reportAbuse' => false,
      'disclaimer' => '',
      'sendAsHtml' => false,
      'sendAsText' => false,
      'sessionVars' => false,
      'postOverides' => 0,
      'eFormOnBeforeMailSent' => '',
      'eFormOnMailSent' => '',
      'eFormOnValidate' => '',
      'eFormOnBeforeFormMerge' => '',
      'eFormOnBeforeFormParse' => '',
      'cssStyle' => '',
      'jScript' => '',
      'submitLimit' => 0,
      'protectSubmit' => 1,
      'requiredClass' => 'required',
      'invalidClass' => 'invalid',
      'version' => '1.4.3',
    )

      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
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Interesting....

      Exact same setup, on the same server, with only one difference, works just fine: the one having a problem is using a temporary IP address for access since the DNS servers are still pointing to the old server. So will wait to see what happens once this new installation goes live later today.

      As soon as the site went live and the DNS resolved properly the mailer worked correctly. Some oddity with the temporary IP address scheme.
        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
        • 11429
        • 90 Posts
        Is there a reason why eform is 1.4.3 but the actual snippet is 1.4.2 ?
          • 28338
          • 46 Posts
          I’m having trouble with Swedish characters (åäöÅÄÖ) in the mail headers. I got them to work in the mail body by changing the charset in class.phpmailer.php, but the subject line and from field either gets cut or looks like crap.

          Someone care to help? smiley
            • 21149
            • 1 Posts
            Have the same problem with german letters üöäÜÖÄß, the form fields should be html-encoded for display on the website and in the email. At least those, which have "html" set.
              • 24278
              • 165 Posts
              Hi, is there an example or can someone guide me on how to use #FUNCTION
              Basically, I want to check if the supplied email (in the form) already exists in the database, and based on the return value either proceed or output a validation message.

              Now, where do I write my function and how do I invoke it in eform.

              I use eform 1.4.3 -- have eformtodb configured and it works great. I would like to only insert the supplied form data into the database if the email provided DOES NOT exist in the database.
                • 23491 ☆ A M B ☆
                • 1,056 Posts
                Quote from: Raavi at Apr 23, 2007, 01:16 AM

                Hi, is there an example or can someone guide me on how to use #FUNCTION
                Basically, I want to check if the supplied email (in the form) already exists in the database, and based on the return value either proceed or output a validation message.

                Now, where do I write my function and how do I invoke it in eform.

                I use eform 1.4.3 -- have eformtodb configured and it works great. I would like to only insert the supplied form data into the database if the email provided DOES NOT exist in the database.

                Check out this post: http://modxcms.com/forums/index.php/topic,8111.msg92591.html#msg92591

                Look at my preventDupes function based on DB results. It even shows which eForm function to use.

                Basic set up:

                1. Create your "preventDupes" function in a snippet. Make sure and include the snippet directly before your [[eform]] snippet call (like that of eForm2db)

                2. Modify your [[eform]] snippet call to run your custom
                preventDupes()
                function on eFormOnBeforeFormMerge

                3. Modify the example to output just an error message, or create a chunk w/ styling/placeholder (per the example)
                  Mike Reid - www.pixelchutes.com
                  MODx Ambassador / Contributor
                  [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
                  ________________________________
                  Where every pixel matters.
                  • 7455
                  • 2,204 Posts
                  I have a snippet that generates a placeholder like [+placeholder+], when I place this in the content it returns the input just fine but now I like to use this placeholder to populate the eform-form.


                  Is this posible at all?
                  when I make a chunk and place the placeholder in there it does not work :

                  <textarea name="emailwinkelwagen" rows="2" cols="20">[+emailwinkelwagen+]</textarea>


                  the [+emailwinkelwagen+] placeholder holds the content of the shopping cart made using shopX.

                  The content needs to be mailed and I like to use Eform for this.

                  if there are other options to populate the form mabe from the session? please let me know.


                  Dimmy
                    follow me on twitter: @dimmy01
                    • 27889
                    • 415 Posts
                    In eform 1.4.3, when you submit a form which contains error (empty required fields) the change made in the form fields are lost, but the $fields parameters in the eFormValidate function contain these changes. Must I repopulate the form (and how )with the content of $fields (or $_POST) or is it normal ?

                    See the attached capture.
                    The required field pagetitle is empty, that stop the validation of the form, but the modified field tvkeywords which was modified to "zzz" is displayed as the first display of the form: "contact,mail,form.."

                    A wish: Could be usefull (for me smiley ) if some parameters could be files ie: tpl,report and the event function.
                      MODx Sites & Prestations: http://dp-site.fr [Last MODx Site]
                      MODx Repository: [HOME] [MetaTagsExtra] / Current Dev: [xFDM]
                      • 30223
                      • 1,010 Posts
                      @Dimmy - You could use the &sessionVars parameter to insert those values (provided that you store them in the session first off course).
                      As eForm does not parse the complete form 1st time around you will have to set the same placeholders in the form template. For example:

                      [!eForm &sessionVars=`emailwinkelwagen` ... !]

                      and
                      <textarea name="emailwinkelwagen" rows="2" cols="20">[+emailwinkelwagen+]</textarea>



                      @Soda - This is not normal. I suspect the error is in the way the form template is constructed. Can you post the template (and the snippet call)?

                      This discussion is closed to further replies. Keep calm and carry on.