In case any one else has this issue:
In our case, the shipment was being created via the API from a third-party. With the Magento API, there's a flag whether or not to send the email on the createShipment call - this flag must be set by the third-party API. However, when done that way, the email doesn't contain the tracking information.
There are two possible solutions to this:
1) Override the Mage_Sales_Model_Order_Shipment_Api file, comment out the sendEmail line in the create function (in Magento 1.7, line 162), then add a line in the addTrack function $shipment->sendEmail(true, ''); after the $track->save() call (in Magento 1.7, line 205). Note this only works if there's only one tracking number per shipment. Also note that this hard-codes to send the email, since the flag doesn't exist on the addTrack call.
2) Instead of relying on the New Shipment email, add an API call. After adding the shipment and tracking number, then add a comment with the sendEmail flag set - then enable and update the New Shipment Comment email template to contain the contents of the New Shipment template.
Hope this makes sense, and hope it helps anyone else who follows.
The cronjob is working (otherwise you would not get this exception) and if your hoster said, that Magento did not try to send any emails, the exception has another reason.
Unfortunately the message is not very precise, but you do get it when the email has no subject or no recipient, so you should double check your email templates and your sales email configuration.
To debug, I suggest to inspect the parameters for mail()
: Edit lib/Zend/Mail/Transport/Sendmail.php
around line 100 and replace:
set_error_handler(array($this, '_handleMailErrors'));
$result = mail(
$this->recipients,
$this->_mail->getSubject(),
$this->body,
$this->header);
restore_error_handler();
with
set_error_handler(array($this, '_handleMailErrors'));
Mage::log("MAIL RECIPIENTS: " . $this->recipients, null, 'mail.log', true);
Mage::log("MAIL SUBJECT: " . $this->_mail->getSubject(), null, 'mail.log', true);
$result = mail(
$this->recipients,
$this->_mail->getSubject(),
$this->body,
$this->header);
restore_error_handler();
Then check var/log/mail.log
after a failed email to see if recipients or subject are missing.
Best Answer
Solved it by changing PhPMail to SMTP.
Fix Source