We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28626
    • 87 Posts
    At first I thought this was a problem with modx but I made this phpscript ’mailYouMTF.php’ saved it as a separate php file and ran it

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

    It displays Message successfully sent! yet no mails arrive at any emailaddress I specify.

    I tried it from an online server same result. Is there a way to find out if the mail is being processed by PHP and sent out? 2 weeks ago this worked just fine.

    Aargh PHP ... >:(
      • 28626
      • 87 Posts
      I checked the logfiles and it seems to time out:

      Oct 20 11:32:37 lamp postfix/smtp[1606]: 4A74524BF7: to=<[email protected]>, relay=none, delay=264006, delays=263856/0.17/150/0, dsn=4.4.1, status=deferred (connect to alt4.gmail-smtp-in.l.google.com[74.125.67.27]:25: Connection timed out)


      Can I do something about this or does anyone know what this actually means?
      Should I change a parameter in php.ini?
        • 26903
        • 1,336 Posts
        You have something blocking your outbound port 25. Perhaps a firewall or your ISP? Some ISP’s only allow you to use their mail serevrs.
          Use MODx, or the cat gets it!
          • 7976
          • 36 Posts
          What shamblett said; maybe your ISP is using port number 2525 or 2500.
          Try google with "myISP smtp port" that wil give you mostly some info about it.
            Jack of all Trades and Proud Honda Zoomer owner. Also available on twitter.
            • 28626
            • 87 Posts
            But I’m testing it from a local server, I have no ports blocked here. Can’t you send mail from a local testserver? When I test it from my online server it’s just the same, but I can’t access the mail.log file there to see what’s wrong.

            Using gmail smtp as in the formIt example doesn’t help either.
              • 7976
              • 36 Posts
              Step.1 Go check if you have your port open on http://www.canyouseeme.org/

              IF port 25 is closed:
              Step.2 Open your port on your router on http://portforward.com/ and after your done proceed with step.1 again

              IF port 25 is open:
              Step.2 Go check your ISP port number. (any connection on the interweb goes through your ISP)

              Also it doesnt matter if your local or on a external webserver, you always need to setup your SMTP. Mostly - if you pay - the webserver is predefined with this SMTP settings.

              Good luck!
                Jack of all Trades and Proud Honda Zoomer owner. Also available on twitter.
                • 28626
                • 87 Posts
                I’m giving up.

                It did work just fine without resorting to any portforwarding at all. For some reason it’s not working anymore.
                Online I don’t know it should work there I filed support ticket there, but they don’t answer.

                If I can’t get something that basic working, I should stop making websites. This site should have been done 2 weeks ago and I can’t deliver it simply because of some f***cking email issues.

                Any workaround possible so I can test if confirm registration and reset password work?
                  • 3749
                  • 24,544 Posts
                  You could try SPForm if all you need is a simple contact form. If your mail system works, it will work out of the box. It might help you figure out what’s wrong.
                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting
                    • 26903
                    • 1,336 Posts
                    Ok, forget MODx and PHP, open a terminal session and from the command line use the ’mail’ command to send mail(man mail for details), this is what PHP uses if not configured to do otherwise, if this doesn’t work you have a server config problem somewhere, if it does then at least you’ll know the prob is a PHP config issue.
                      Use MODx, or the cat gets it!
                      • 28626
                      • 87 Posts
                      @BobRay I don’t think that will help since it also doesn’t work in plain php it’s something with the mailserver I guess.

                      @shamblett Thanks for all the trouble to help me find the problem.

                      I don’t have mail on my server.


                      I have sendmail and postfix. In the PHP.ini it states sendmail.

                      sendmail_path = "/usr/sbin/sendmail -t -i"