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

    I think I;m trying to run before I can walk, but I’m having a problem with the ContactForm snippet.

    I have amended the base snippet to only have the subjects that I want, but when I fill in the form and press the button I get:

    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « PHP Parse Error »

    PHP error debug
    Error: mail() [function.mail]: SMTP server response: 501 <[(emailsender)]>: missing or malformed local part
    Error type/ Nr.: Warning - 2
    File: C:\Data\htdocs\cb4u\manager\includes\document.parser.class.inc.php(691) : eval()’d code
    Line: 107

    Parser timing
    MySQL: 0.0029 s s (5 Requests)
    PHP: 0.2291 s s
    Total: 0.2320 s s

    This is pretty much gobledygook to me - any ideas?

    I’m running WinXP, Apache 2.0.52, PHP 5.0.3

    Any help would be much appreciated.

    Regards,
    Paul.
      • 22940
      • 16 Posts
      Found the problem:

      I had set the $recipient_type = "static".

      I removed this and it now works! huh
        • 22940
        • 16 Posts
        Aaaaargh!!

        Now have another problem.

        I’ve hacked the form to give a better layout and added some additional fields, but I now get:

        « MODx Parse Error »
        MODx encountered the following error while attempting to parse the requested resource:
        « PHP Parse Error »

        PHP error debug
        Error: mail() [function.mail]: SMTP server response: 503 valid RCPT command must precede DATA
        Error type/ Nr.: Warning - 2
        File: C:\Data\htdocs\cb4u\manager\includes\document.parser.class.inc.php(691) : eval()’d code
        Line: 140

        Parser timing
        MySQL: 0.0034 s s (5 Requests)
        PHP: 0.2330 s s
        Total: 0.2364 s s

        Fixing the first problem was a result of a wild stab in the dark, but this has me stumped! sad
          • 22940
          • 16 Posts
          OK, back to first principles...

          I’ve copied the base ContactForm to a new snippet.

          I’ve removed the multiple subject lines, and removed the subject dropdown from the form.

          I’ve set the $recipient_type to "static" and get:

          « MODx Parse Error »
          MODx encountered the following error while attempting to parse the requested resource:
          « PHP Parse Error »

          PHP error debug
          Error: mail() [function.mail]: SMTP server response: 501 <[(emailsender)]>: missing or malformed local part
          Error type/ Nr.: Warning - 2
          File: C:\Data\htdocs\cb4u\manager\includes\document.parser.class.inc.php(691) : eval()’d code
          Line: 107

          Parser timing
          MySQL: 0.0029 s s (5 Requests)
          PHP: 0.2291 s s
          Total: 0.2320 s s

          It would appear that the $email variable is actually returning "[(emailsender)]" as the address to send to rather than the email address set up for the website.

          Can anyone tell me how to get around this without using the subject dropdown please?

          Thnx
          Paul.
            • 33175
            • 711 Posts
            Heloo ,

            Which is the code of the document which calls your snippet?
              Sorry for my english. I&#39;m french... My dictionary is near me, but it&#39;s only a dictionary !
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              I just had the same problem; changed the [(emailsender)] near the beginning of the snippet code to $modx->config[’emailsender’] and fixed the problem. Don’t know why that broke in the new version, though, it worked fine in the old one.
                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
                • 33175
                • 711 Posts
                I use Modx 0.9.1 and my contact page contents "[[ContactForm? &sendTo=`[(emailsender)]`]]"
                I have not error when I send email using this form.

                I installed version 0.9.1 (I did not update earlier version). Is that could not come from there?
                  Sorry for my english. I&#39;m french... My dictionary is near me, but it&#39;s only a dictionary !
                  • 22940
                  • 16 Posts
                  Thanks Susan - that works a treat !;D

                  @ Guillaume: This only seems to occur when you choose to use ’static’ for the recipient_type.

                  Hope this helps.

                  Cheers,
                  Paul.