I’m suddenly getting errors “[FormIt] An error occurred while trying to send the email. Could not instantiate mail function.” for two forms in the same web site.
The forms had been working fine so far. For debugging I reduced the form to the hook ‘email’ only, still the same message. The emailTo-address is of the same domain as the site, there are no special settings for smtp etc. Just FormIt.
I’m using:
MODX 2.8.3
PHP 7.3.30
FormIt 4.2.6
I’m wondering if there is a known issue? Should I ask the provider for recent changes he may have made to their systems? I’m lost a bit …
maybe post your code here maybe there is a mistake?
also check error log?
check under system info phpmailer version. you can also test phpmailer by just doing the forgot password option on login, then you know that php mailer is working or not.
if it works it must be an issues with formit, your code or mailer hook
Hi Bob,
thanks for your hint to the QuickEmail Extra - was not aware before.
I’m getting the message:
“Send failed - Mailer error info: Mail-Funktion konnte nicht initialisiert werden.” (Could not be initialized)
With debug mode, I’m getting this:
Blockquote
Properties (from parameters, property set, or snippet default properties:
Don’t know if this can help: I’m getting a lot of error messages, not related to FormIt or QuickEmail or sending form messages, as far as I see:
"[2021-09-22 15:23:24] (ERROR in xPDO::getService @ …/www/core/xpdo/xpdo.class.php : 1235) modRestClient::__construct is deprecated since version 2.3.0. Use the modRest classes instead.
[2021-09-22 15:23:24] (ERROR in modRestCurlClient::__construct @ …/www/core/model/modx/rest/modrestcurlclient.class.php : 26) modRestClient::__construct is deprecated since version 2.3.0. Use the modRest classes instead.
"
I removed the detailed path info between @ and …/www/… for this post.
Some unrelated deprecation warning is not the problem.
The error message “Could not instantiate mail function.” (“Mail-Funktion konnte nicht initialisiert werden.”) indicates that the mail() function in PHP returns false when sending the mail. Unfortunately it’s unclear why.
Maybe you could try executing this function directly in a snippet and see if you gain more insight this way.