My client is reporting that starting a few days ago, emails are not being sent to admin and customer on a completed transaction. This site has been running with no issues for nearly a year. Notifications are handled through CartThrob, which I believe uses the standard EE mail class.
I haven't made ANY changes. I did a quick test to test out the email class by sticking this in a template (from EE docs): (emails are real in my template, fake here)
$from = "me@mydomain.com"; $recipient="me@gmail.com"; $email_subject = 'testing at 2:25 on CPC'; $email_msg = "here's the test from debra"; ee()->load->library('email'); ee()->load->helper('text'); ee()->email->wordwrap = true; ee()->email->mailtype = 'text'; ee()->email->from($from); ee()->email->to($recipient); ee()->email->subject($email_subject); ee()->email->message(entities_to_ascii($email_msg)); ee()->email->send(FALSE); echo ee()->email->print_debugger(array('headers')); //ee()->email->Send();
Which should send the mail and show me the headers. Instead I get a blank page. I should be seeing PHP errors, if any. If I turn on the debug for EVERYONE, not just super-admin (which I am) I see:
Fatal error: Call to undefined function ee() in /www/mydir/public_html/mysys/expressionengine/libraries/Functions.php(680) : eval()'d code on line 6.
In Functions.php, that is pointing to this:
// --------------------------------------------------------------------
/**
* eval()
*
* Evaluates a string as PHP
*
* @access public
* @param string
* @return mixed
*/
function evaluate($str)
{
return eval('?'.'>'.$str.'<?php ');
}
// --------------------------------------------------------------------
(Yes, I have php tags around the code in my template. Yes, I have PHP enabled in my template.) It's just not loading the email function from the library.
I thought EE might have been mysteriously corrupted somehow, so I upgraded to the next version from the one we had, so we are now 2.53. No issues with the upgrade, but still failing to call email class.
I can send email through the Communicate module. I've put in a support ticket with our host to see if it's something server-related. I tried this exact same template on another site I have at the same host, and it works perfectly.
Anyone seen anything like this or have any ideas? It's a complete mystery to me!