-1

after Magento upgrade from v1.9.1.0 to v1.9.2.0 mails stopped sending. In system.log I see an error HRADERS ALREDY SENT. However, this message appear when I press Add to cart button, but users' checkout process goes smoothly. Moreover, I see successful orders in the dashboard where it is said that customer is notified and status order - pending. Thus, I am not sure whether this issue causes problem with email.

In addition, I have a list of files in system.log that are loaded and probably have white space or BOM and I checked them but found nothing. The list contains 334 files, so it is possible that I miss something. Is there a way to find a file that causes Headers error ?

Also, I checked if I can send email just using mail() from "simple" php - it works.

How to start solving problem with emails. I read that I should select crone.php in cPanel, and I did it. How to know whether emails are not being formed or could not be sent?

1 Answer 1

0

First thing you should check is exception.log to see if there is anything that can help there.

In the Magento 1.9.2 upgrade they have added a mail queue system for some of the emails that get sent. The account success email is sent immediately:

$mailer->setSender(Mage::getStoreConfig($sender, $storeId));
$mailer->setStoreId($storeId);
$mailer->setTemplateId(Mage::getStoreConfig($template, $storeId));
$mailer->setTemplateParams($templateParams);
$mailer->send();

However emails such as the order invoice order is added to the mail queue and is sent on cron:

$emailQueue = Mage::getModel('core/email_queue');
$emailQueue->setEntityId($this->getId())
            ->setEntityType(self::ENTITY)
            ->setEventType(self::EMAIL_EVENT_NAME_NEW_ORDER)
            ->setIsForceCheck(!$forceMode);
$mailer->setQueue($emailQueue)->send();

You should should have your cron setup to run around every 5 minutes. See magento cron your should also look at installing AOE_Scheduler to help manage your cron tasks

4
  • exception.log is not created. However, I have just found that emails were created in database. By the way, cron is configured. I will dig towards the cron. Jul 31, 2015 at 14:12
  • Well, I found that I should add a string to cron.php $isShellDisabled = true;. Now my cron.php is called from cPanel. Aug 2, 2015 at 6:57
  • Did this get your emails working?
    – rob3000
    Aug 3, 2015 at 0:51
  • Yes, I did and now mails are sent. However, it still needs tuning, because my cPanel sent me a notification once with an error: Fatal error: Call to a member function load() on a non-object in app/code/core/Mage/ProductAlert/Model/Observer.php on line 135. But, I will observe it. Aug 3, 2015 at 18:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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