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

    I just moved my build site from one host to another. I also upgraded from modx 9.61 to 9.61 p2.

    When someone submits a form on this page: http://www.thechickenbox.com/index.php?id=59 they get this error message: Main mail: Mailer was unable to send mailCould not instantiate mail function.

    The form worked on my old host and doesn’t work on the new one. On my new host i have mail forwarders set up so that emails sent to [email protected] go to [email protected].

    Any Help to get this set up will be much appreciated.

    Noah
      • 19315
      • 84 Posts
      Hi,

      I’ve been thinking about using Eform for Ajax submission. I’ve never done any ajax-y things before though, so I’m not sure if I am on the right track... From my understanding of the earlier posts:

      - Have a hidden option in the form, say isAjax. Set to 0 by default.
      - With Javascript set the isAjax to 1 on the page for Ajax submission.
      - In the snippet just do the usual when the received value of isAjax is 0.

      Now... if isAjax is received as 1, then the (modified) eForm changes the form template used. Then the whole page is sent back to the browser, and Javascript would be used to extract the appropriate validation messages/thank you and put them in the appropriate places on screen.

      However, if Javascript is used to extract information from the received page, then I’m a bit confused why the snippet needs to do anything differently at all. Couldn’t the same form template just be used? Thus the server-side form processing would be identical in all cases.

      (Alternatively: if eForm is modified to change the form template, could the snippet maybe erase all of the document content when it is being processed if isAjax is 1? Thus the entire page wouldn’t need to be sent. Would this be possible?)
        • 25547
        • 61 Posts
        snip
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          The first pass through the parser it changes all occurrences of [! and !] to [[ and ]] so it can be parsed as a snippet in the next pass.

          Is your snippet call all on one line, no carriage returns? That can cause it to fail.
            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
            • 26903
            • 1,336 Posts
            Ok, without reading this whole thread, is it possible to change the mailer eform uses? I know it uses phpMailer as a backend but the eform code seems to always set the mailer as ’IsMail’, I need to use SMTP really and set the SMTP parameters accordingly ie host etc. We could do this by letting the caller instantiate a mailer class and set the mailer accordingly then pass this as a parameter to eform, it could do the rest as normal, or we could pass these as parameters to eform but this would be a bit kludgy.

            Sorry if I’ve missed something here or its been covered already, if not I’ll gladly write a patch to do this.

            Any answers or thoughts here.

            Thanks
              Use MODx, or the cat gets it!
              • 7231
              • 4,205 Posts
              Yes it is possible. I remember some users using swiftmailer as the mailer. Do a search for swiftmailer and see if it returns anything.
              http://modxcms.com/forums/index.php/topic,19370.0.html
                [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                Something is happening here, but you don't know what it is.
                Do you, Mr. Jones? - [bob dylan]
                • 26903
                • 1,336 Posts
                Yes thanks, I’ve updated to use swiftmailer as per the instructions, works a treat and gives me extra flexibilty for future usage.

                This is were Modx trumps the rest, from posting the question on the forums to having a working solution on my production server took about 1 hr.
                This includes trialling it on my dev server.

                Didnt even have to hack any code, just replaced the files and it worked first time.

                Good stuff here. I’m definitely a fanboy!
                  Use MODx, or the cat gets it!
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  Actually, I’ve modded the eForm snippet to use SMTP with the default phpmailer library; it wasn’t at all difficult. They have excellent documentation on their site.
                    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
                    • 10916
                    • 13 Posts
                    Hi, thank you for creating this wonderful snippet. =)

                    I have a small problem. When someone submits the form, they are always being sent a copy of the email... I set &ccsender=`0` but the emails are still coming through. huh

                    I am using the latest version of eForm, here is the snippet call:

                    [!eForm? &formid=`ContactForm` &subject=`Subject` &from=`[+email+]` &fromname=`[+name+]` &ccsender=`0` &tpl=`ContactForm` &report=`ContactFormReport` &invalidClass=`invalid` &requiredClass=`required` &cssStyle=`ContactStyles` &to=`[email protected]` &gotoid=`3` &protectSubmit=`0` !]
                      • 17673
                      • 194 Posts

                      I created my 1st eform page and experiencing a strange problem; the mail gets sent, but the addresses specified in the &to parameter receive it as a blank e-mail with an ’unnamed’ text/html attachment, which finally contains the data; the sender (&ccsender=1) receive it as a regular mail instead !

                      what can it be ?!

                      also how do I activate the eForm placeholders in the gotoid page ?


                      Ciao, thanks

                        ----------------------------------------------------------
                        http://www.linkedin.com/in/lucapost/
                        http://www.twitter.com/lukwe/
                        ----------------------------------------------------------

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