ERROR: Could not instantiate mail function

ERROR: Could not instantiate mail function

by Genner Cerna -
Number of replies: 3
See attachment!
Attachment error.jpg
Average of ratings: -
In reply to Genner Cerna

Re: ERROR: Could not instantiate mail function

by Basil Gohar -
I'm having the same problem myself on a Windows machine, and encountering problems when I move to production on a Linux box.  Does anyone know the solution to the problem this error represents?
In reply to Basil Gohar

Re: ERROR: Could not instantiate mail function

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi,

You could perhaps check the smtphosts field in the mail section of Administration >> Configuration >> Variables has been filled in correctly and does not contain any white space.
In reply to Helen Foster

Re: ERROR: Could not instantiate mail function

by Basil Gohar -
Actually, I had just resolved the issue on our side with a serious, unrecommended hack.  I set the $header variable to ''.  Now it works exactly as I want it to, since we do not have normal e-mailing except in one very special case.

Everything else in our setup is routed through the internal messaging system.  This keeps students from e-mail each other and keeps everything onsite.