$emailTemplate = Mage::getModel('core/email_template')
->loadDefault('test_template');
$emailTemplateVariables = array();
$emailTemplateVariables['test'] = 'Branko';
$emailTemplateVariables['name'] = 'Ajzele';
$emailTemplateVariables['reviewurl'] = Mage::getUrl('test/index/review');
echo $processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);
$emailTemplate->send('test@gmail.com','John Doe', $emailTemplateVariables);
output echo
It is time to review Branko
Hi Ajzele
Click this Make a Review
error
2015-06-17T10:17:10+00:00 ERR (3):
exception 'Exception' with message 'This letter cannot be sent.' in /var/www/servicecenters/app/code/local/Aschroder/SMTPPro/Model/Email/Template.php:40
Best Answer
Try this:
So the problem was:
!Mage::getStoreConfigFlag('system/smtp/disable')
which you can fix up inAdmin > System > Configuration > Advanced > System > Mail Sending Settings
and changeDisable Email Communications
toNo
so the emails are NOT disabled.Explanation
Look at the
/app/code/core/Mage/Core/Model/Email/Template.php
.The code throwing this error is:Look at
isValidForSend()
:More info.