We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28626
    • 87 Posts
    I’ve been trying for more than 2 weeks now to get modx to send emails. It works for a couple of emails that go through then for no apparent reason whatsoever it stops, no errormessages nothing, just the mails stop.

    I tried this on a local server, online server, with smtp, without smtp always the same result it works for a couple of mails then it stops.

    To be sure I started from scratch installed the latest modx version, installed only formit as package, used the exact example from the docs with exception of the emailaddress.

    Results again the same it works for a while then it stops working for no reason.

    When I use this simple script it works each time:

    <?php
    if (mail('[email protected]', 'My Subject', 'My Message')) {
    echo("<p>Message successfully sent!</p>");
    } else {
    echo("<p>Message delivery failed...</p>");
    }
    


    So it’s not the server. There is no logic in it. I started all over again and now it doesn’t send emails, so it seems like somehow my server doesn’t send mails coming from modx after a certain amount have been sent while still allowing mails from the simple php script to pass through. That makes no sense but I can’t debug it.

    It’d be happy to give someone access to my server to see if I’m doing something wrong as I’m loosing valuable time with it and all suggestions made previously don’t help.

    Also using the login snippet or any other add-ons to send mails result in the same behavior.

    I went to eat tried again and it’s working again. It seems after some time it’s unblocked again.

    Another theory I have is maybe gmail blocks the mails if too many are sent in a short time, but why does it only blocks the mails from modx and not from the mailscript? It’s really crazy.
      • 28626
      • 87 Posts
      I tried again, clean install only FormIt installed, it worked fine, went to bed tried again it doesn’t work anymore. Ok I cleared the cache, renamed the email template, tried again and it works fine again. Could this be cache related? I use this
      [[!FormIt? so it shouldn’t be cached. Really this is driving me nuts, as I can’t seem to pinpoint where it goes wrong.

      Can you debug snippets? Is there somehow a way to visualize what’s going on in the background so I can trace this strange behavior?
        • 28626
        • 87 Posts
        Since nobody seems to have the same issue, I’m gonna switch hosting try it there and if that doesn’t work, then I quit working with Modx.
          • 22303 MODX Staff
          • 10,725 Posts
          Sure sounds like a cache issue with your FormIt usage to me. I would certainly love to hear if you diagnose any more detail on what the issue is. We have used Revolution’s email API on several large production sites with no real trouble to speak of other than issues related to servers being identified as spam providers, and other fun reasons no one should run their own mail server. But I at least cannot reproduce anything like you are describing here.
            • 28626
            • 87 Posts
            I tried to setup modx on another host but I couldn’t install any packages there, tried to install a local package and suddenly my site was inaccessable. Removed all the files unzipped the latest modx try to setup the thing again and I now get some issue with

            FATAL ERROR: MODx Setup cannot continue.
            Make sure your PHP session configuration is valid and working.
            


            I really have had it. I’m not going to try anymore, I’m tired, can’t think straight.
              • 7327
              • 195 Posts
              Could it be a daily limit set by your mail server? Try using another e-mail account to send / receive your email (the e-mail address you put in MODx’s backend setting.)

                • 28626
                • 87 Posts
                Well I just set up a different server locally this time I used Mamp Pro which allows you to set postfix settings and used the smtp of my internetprovider and it just worked.

                At least I can stop worrying about email until all features are in place.

                Still don’t understand why it wasn’t working online but it must be related to the hosting company I assume and not to modx itself (at least that’s what I hope).
                  • 7327
                  • 195 Posts
                  I had a problem where if I used a specific email address as my installation’s from-addy, I stuff sent gets stripped off of its body huh.
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    I use my hosting SMTP server to send mail from my free MAMP installation; I just always use SMTP and not mail().
                      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