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

    One of the servers i use for some Modx Revolution website has suddenly disabled the escapeshellcmd() function in PHP because of security.

    [2017-08-01 17:35:23] (ERROR @ /home/business/domains/mydomain.com/public_html/core/model/modx/mail/phpmailer/class.phpmailer.php : 1407) PHP warning: escapeshellcmd() has been disabled for security reasons



    I allready noticed that we can use the SMTP version in formit to send the e-mails. But in these websites on this server we change the following in each e-mail:

    &emailTo=`[[+selected_accountmanager]]`


    For the SMTP version this field mus be fixed. (please correct me if iam wrong)

    Is there an update/upgrade in the newer Modx versions that can use php mail() function like before?
    We use version 2.5.2-pl

    Thanks in advance

    This question has been answered by voklee. See the first response.

      • 17301
      • 932 Posts
      You should be able to ask your host to reenable it or if you have cpanel/plesk access you should be able to do that yourself also. I'd be more concerned about why it would have been disabled though, sometimes security measures are in place to disable such functions if your site is deemed to be sending out malicious or unsolicited emails so ensure there are no scripts running on your site that could be questionable.

      Alternatively you should be fine to use the above emailto property with SMTP.

      If possible you should upgrade anyhow though to the latest version of MODX.
        ■ email: [email protected] | ■ website: https://alienbuild.uk

        The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
      • discuss.answer
        • 39827
        • 42 Posts
        Hi LK thanks for your answers.

        Reenable is not what they want to do. (they responded) I dont understand why because all other servers i use simply allow this function.
        I will first start updating the site to the highest version. Guess that will not help but we will see.

        You say that using the SMTP (activate the setting. putting in a username, password, etc...) should work.
        Problem i saw today is that if i put in the 'emailto' formit setting `[email protected]` it tries to use this as username to login with SMTP. If i put in the 'emailto' formit setting `[email protected]` it will try to use that box as SMTP.
        What i do wrong?

        Thanks in advance

        UPDATE:
        - update to last version was not a solution. (but cant be bad..)
        - I have entered the SMTP version and got it to work.

        Again thanks for the quick responses.
        If anybody faces same problem and error PM me and ill show the SMTP setup. [ed. note: voklee last edited this post 9 years, 1 month ago.]