-
- 4,213 Posts
The snippet saving issue sounds like a mod_security thing.. is that on in your server environment? look at modx wiki for mod_security
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
All that line does is check the value of safe_mode, it neither sets nor unsets it.
-
- 19 Posts
Hi,
I am getting the same error, "Could not instantiate mail function". I also tried to send mail from a basic PHP page and all seems fine, I receive the email. Did you manage to resolve the issue? If yes, could you let me know what it was?
Thanks
-
- 19 Posts
Hi, I got this issue figured out. When adding the code to the page, the email address was automatically made an active mailto and that was messing up the code. My form seems to be working again and I don’t get the error on the php mail. I still haven’t managed to write the content to the database though. Any suggestions welcome...
Thanks for all your help and suggestions.
-
- 4 Posts
Hi, I had the "could not instantiate" problem as well and after reading this thread here is what worked for me :-
The simple php mail scripts worked ok.....
In method MailSend in class.phpmailer.php:-
if ($this->Sender != "" && strlen(ini_get("safe_mode"))< 1)
The object attribute "Sender" is blank so this portion of code is skipped (the safemode check appears to test whether safemode is not set - (it is set on my system so this skips even if I instantiated the Sender attribute in eform.inc.php)
So I grabbed the sendmail_from parameter and used that in the else block
else
// amended lines added by CMD 15July08 needs a valid from address in mailto
$old_from = ini_get("sendmail_from");
$headers = ’From: ’ . $old_from . "\r\n" .
’Reply-To: ’ . $old_from . "\r\n" .
’X-Mailer: PHP/’ . phpversion();
$rt = @mail($to, $this->EncodeHeader($this->Subject), $body, $headers);
Ultimately my server didn’t like the format of the @mail call either in the initial ’If’ block or the ’else’ block and that reason is beyond my limited knowledge!
-
- 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?