We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40494
    • 9 Posts
    Hi! I noticed, that my modx installation wouldn't send any emails.

    I tried QuickMail to get some more information on this issue. This is what quickmail says:

    System Settings (used if property is missing):
    emailsender System Setting: [email protected]
    site_name System Setting: MODX Revolution
    Properties (from parameters, property set, or snippet default properties:
    Tpl chunk name: 
    subject: 
    to: 
    fromName: 
    replyTo: 
    emailSender: 
    allowHtml: 1
    message: 
    Final Values (actually used when sending email):
    subject: Default Subject
    to: [email protected]
    fromName: [email protected]
    replyTo: [email protected]
    emailSender: [email protected]
    allowHtml: 1
    Message Body: Default Message
    Send Failed
    Mailer error info: Could not instantiate mail function.
    Server Debug Information:


    I tried a script like this:
    <?php
    $to = "[email protected]";
    $subject = "Test mail";
    $message = "Hello! This is a simple email message.";
    $from = "[email protected]";
    $headers = "From:" . $from;
    mail($to,$subject,$message,$headers);
    echo "Mail Sent.";
    ?> 


    This worked without any problems.

    Can you help me solve this issues?

    What additional information do you need?

    Thank you!
      • 3749
      • 24,544 Posts
      Did you use the same value for $from in both cases? Some hosts are very picky about the email address you use and how it compares to the To field and Reply-to fields. And the default values often fail on a localhost install.

      You could also try switching to SMTP.


      ------------------------------------------------------------------------------------------
      PLEASE, PLEASE specify the version of MODX you are using.
      MODX info for everyone: http://bobsguides.com/modx.html
        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
        • 40494
        • 9 Posts
        Thank you for your answer!

        I used the same values in from and to now. I even had the same mail content (copied from the quickmail debug page).

        In my test mail sending works, but modx is not able to send a mail.

        Are there further steps I can take?
          • 3749
          • 24,544 Posts
          You could post the code you're using to send the mail in MODX.

          You might have a missing or corrupted file in your MODX install, especially if you used FTP to transfer the files.

          Make sure you're not using RichText when editing the mail form. That can mangle some of the settings.

          As I said, you might try using SMTP. Go to System -> System Settings and put SMTP in the search box at the upper right. Use the credentials for someplace that you have an SMTP account. I usually use Gmail.

            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
            • 40494
            • 9 Posts
            Thank you!

            Now I realize that you generated QuickEmail! Great stuff for debugging smiley

            SMTP would be an option, but I hoped that the problem can be solved...

            I zipped the folder core/model/modx/mail/ and will upload it here.

            I also post an image of the page that generates the mail (but I think that's not very informative).

            Additionally I post the settings related to email settings from the manager (quip is not included, hope that's no problem... and it's in german)
              • 40494
              • 9 Posts
              Would it be possible, that there is a problem with additional_headers or additional_parameters in phpmailer? (see mail()-function)?

              Is there an easy way to check these parameters?

              [edit] I think I can rule our corupted packages: I installed modx on another webspace at the same hoster and I have the same issues. I used ssh to login at the hoser and used wget to download modx, so it was really a new copy of modx [ed. note: speendo last edited this post 14 years, 2 months ago.]
                • 3749
                • 24,544 Posts
                I meant to post the *your* code that's failing to send the email (or at least an explanation of what you're using to send them). There are lots of ways to send mail in MODX and we don't know what you're using.

                BTW, I notice in your System Settings that the two Quip Settings at the bottom are empty. You might try filling them in.


                ------------------------------------------------------------------------------------------
                PLEASE, PLEASE specify the version of MODX you are using.
                MODX info for everyone: http://bobsguides.com/modx.html
                  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
                  • 40494
                  • 9 Posts
                  Hi Bob!

                  Sorry, I think that's a misunderstanding. I'm not trying to develop a way to send mail using modx. I just want that passwort reset via email works.

                  I will try to setup quip but I'm sure that's not the reason: I tried a different install of modx on the same server without installing quip - i had the same issues.
                    • 3749
                    • 24,544 Posts
                    OK, I get it now, though I can't think of any reason that would be the case. Usually, when that happens, it means that MODX's settings don't match those of your server (see this: http://stackoverflow.com/questions/11493376/modx-emails-not-working).

                    But AFAIK, QuickEmail uses the same class to send the email.

                    Check the forgot_login_email System Setting.and make sure it's set and check the MODX error log (Reports -> Error Log).


                    ------------------------------------------------------------------------------------------
                    PLEASE, PLEASE specify the version of MODX you are using.
                    MODX info for everyone: http://bobsguides.com/modx.html
                      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
                      • 40494
                      • 9 Posts
                      hehe, in stackoverflow that's also my thread wink

                      The error log also is not very informative. It says:
                      [2012-07-15 11:03:51] (ERROR @ /manager/index.php) [email protected]

                      Btw. thank you for your help!