not able to send email with email template
Try this:
So the problem was: !Mage::getStoreConfigFlag('system/smtp/disable')
which you can fix up in Admin > System > Configuration > Advanced > System > Mail Sending Settings
and change Disable Email Communications
to No
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:
if (!$this->isValidForSend()) {
Mage::logException(new Exception('This letter cannot be sent.')); // translation is intentionally omitted
return false;
}
Look at isValidForSend()
:
public function isValidForSend()
{
return !Mage::getStoreConfigFlag('system/smtp/disable')
&& $this->getSenderName()
&& $this->getSenderEmail()
&& $this->getTemplateSubject();
}
More info.
For me the Problem was, that I defined a custom email template via config.xml of my own module and forgot to set the comment block with subject and so on.
<!--@subject Welcome, {{var customer.name}}! @-->
<!--@vars
{"store url=\"\"":"Store Url",
"var logo_url":"Email Logo Image Url",
"htmlescape var=$customer.name":"Customer Name",
"store url=\"customer/account/\"":"Customer Account Url",
"var customer.email":"Customer Email",
"htmlescape var=$customer.password":"Customer Password"}
@-->
<!--@styles
@-->