We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1777
    • 4 Posts
    Had the same issue on IIS 7 using eForm.

    Trying the simplest example above did not work until I replaced /n with /r/n in the message.

    I finally got it to work by changing line 223 in class.phpmailer.php from

    var $LE              = "\n";

    to
    var $LE              = "\r\n";

      • 41824
      • 19 Posts
      Hey Everybody,

      I don’t know if this will help anyone, but I figure it can’t hurt to post my experience with this.

      I got this error with a client’s site. They are being hosted on Yahoo!’s servers. Yahoo! apparently has certain restrictions, and because my &from address was not on Yahoo!’s list of recognized company e-mail addresses, I got the "could not instantiate mail function error". To fix it, I had to log into their Yahoo! Small Business Control Panel, go to the mail section, and either find an official company e-mail address, or in my case, make a new "user" address of [email protected] (where clientname.com is the client’s url, of course). Once Yahoo! Servers saw that the e-mail was being sent by someone it was familiar with, the form worked!

      Again, this might not be applicable to many people out there, but I thought I’d pass it along.
        • 30699
        • 3 Posts
        Hi guys! I just recently experienced the same problem with my site. I researched from this forums and yes, I read all your posts. The cause of the problem on my case though was that I set 3 email recipients on the $to variable separated by comma since I read on the eform documentation that I can do multiple emails. I didn’t know that was the problem until I made a test mail and found out that the mail sending works perfectly fine. So it had to be the eform scripts. Then, true enough, it was the emails i set.

        I hope this helped a lot. God bless! laugh
          • 4377
          • 15 Posts
          i have got the same error, the solutions offered in this topic all turn out to be no success.

          tried the mail PHP scripts and they work fine.

          anyone know a fix to what is going on here?
            • 40045
            • 534 Posts
            Hi folks,

            I have the very same problem on an actual project and I just don’t know where the problem could be^^...tried your example with

            <?php
            $message = "Test 1\r\nTest 2\r\nTest 3";
            mail('[email protected]', 'Testing mail function', $message);
            echo $message;
            ?>


            when I call it (named mail.php) there are no errors displayed but I don’t recieve an email...because of this I wrote to the hosting-support...tried also the \n to \r\n change (on line 223 in the phpmailer class), didn’t help, and then I tried also change on the else statement on line 438, also didn’t work...

            this is somehow annoying, I have eform up and running on another project (different hosting) but this sould not happen, where is the root of this problem^^?


            EDIT: I tried also to change the eform.inc to SMTP (look here: http://modxcms.com/forums/index.php/topic,36108.msg218125.html#msg218125), now I’m getting email =)...wtf
              • 6531
              • 154 Posts
              I am getting the same error ...

              Tried all the fixes suggested here; nothing worked.

              has this been solved?
              • Many shared hosting servers will have the mail() function disabled to try to prevent spam being sent from their servers. If that is the case, you’ll need to change things to use an SMTP server, which requires a login to send mail. (the same one you use for your computer’s mail client program).

                http://modxcms.com/forums/index.php?topic=32969.0
                  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
                  • 7436
                  • 1 Posts
                  I am having similar problems and receive the error message "Could not instantiate mail function" when email should get sent from this eform snippet

                  [!eForm? &formid=`ContactUsForm` &subject=`` &to=`info@myserver` &tpl=`eFeedBack` &report=`eFeedBackReport` &thankyou=`eFeedBackThanks` !]

                  I am led to think that my php mail setting is ok as I can run the test scripts listed on this thread successfully and receive those emails.

                  I think there is an issue somewhere with the handling of the "@" sign because when I change my snippet from "&to=`info@myserver`" to something without the at sign, for example "&to=`info`" the error message does not occur and the eFeedBackThanks gets displayed but of course this is not a proper email address so the email goes nowhere.

                  Any ideas for resolving this issue?

                  for me the solution was only to leave blank &to=`` This parameter is not necessary if you write an e-mail address in Tool/configuration/User. By default the eForm take this mail.
                  To resolve the problem you have to leave blank but dont forget to write it. Otherwise it wont work
                  [!eForm? &formid=`ContactUsForm` &subject=`` &to=`` &tpl=`eFeedBack` &report=`eFeedBackReport` &thankyou=`eFeedBackThanks` !]

                  After two days at the end it’s works
                    • 36805
                    • 354 Posts
                    Quote from: dimecris at Jan 18, 2011, 11:50 AM

                    for me the solution was only to leave blank &to=`` This parameter is not necessary if you write an e-mail address in Tool/configuration/User. [...]
                    I tried this idea first (blank &to field). While the error message went away I still did not get the mail. I updated phpmailer to version 5.1 and now it works (Evo comes with 1.73 go figure)
                    • I’ve opened a request for a phpmailer update for Evo.

                      http://bugs.modx.com/issues/3757

                      There is a complication, however. PHPMailer version 5.1 is for PHP 5/6. The version for PHP 4 is version 2.0.4
                        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