-> sample_order.html file in put your html (Mail sending) content.
Step 3: Sending the email !
-> app/code/[codePool]/[Namespace]/[Module]/controllers/IndexController.php
//Send Custom Email Start
$emailTemplate = Mage::getModel('core/email_template')->loadDefault('sample_order');
$senderName = Mage::getStoreConfig('trans_email/ident_general/name');
$senderEmail = Mage::getStoreConfig('trans_email/ident_general/email');
$name = $data['name'];
$email = $data['email'];
$pro_name = $data['product_name'];
$pro_img = $data['product_img'];
$pro_sku = $data['product_sku'];
$pro_color = $data['color'];
//Variables for Confirmation Mail.
$emailTemplateVariables = array(
'customer_name' => $name,
'product_name' => $pro_name,
'product_img' => $pro_img,
'product_sku' => $pro_sku,
'product_color' => $pro_color
);
$processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);
//Sending E-Mail to Customers.
$mail = Mage::getModel('core/email')
->setToName($name)
->setToEmail($email)
->setBody($processedTemplate)
->setSubject('Sample Order')
->setFromEmail($senderEmail)
->setFromName($senderName)
->setType('html');
try{
//Confimation E-Mail Send
$mail->send();
}
catch(Exception $error)
{
Mage::getSingleton('core/session')->addError($error->getMessage());
return false;
}
//Send Custom Email End
Setp 4: Your Mail Send Sucessfully.