2

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!

1 Answer 1

1

Just wondering are you using SMTP and Gmail? If so I ‘m having a sending problem since 7/19 just posted here

mike

2
  • I am not. It turns out it was something with the server at the host. Apparently another site in the shared cluster was compromised, and it affected our site. It took a few days for it to resolve itself, and now things seem to be back to normal. However, the host did suggest we use Mandrill, and simply bypass the whole thing. There's also an EE plugin called Escort that makes it all easier, supposedly. I will be probably checking that out.
    – Debra
    Jul 21, 2013 at 20:05
  • It's also worth pointing out that Postmaster will do what you need, and a whole lot more. Escort is great for basic notifications, but Postmaster allows you to go to the nth degree. objectivehtml.com/postmaster Jul 22, 2013 at 19:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.