Custom Sending emails in magento

you can put this script in controller or any event of user

<?php

$email_to = 'xyz@gmail.com';

$receiveName = 'xyz';

$vars = data of user

$template_id = "New email"; //Name of email template
$email_template = Mage::getModel('core/email_template')->loadByCode($template_id);  //load templa
$email_template->setSenderName(Mage::getStoreConfig('trans_email/ident_sales/name'));
$email_template->setSenderEmail(Mage::getStoreConfig('trans_email/ident_support/email'));

$email_template->send($email_to,$receiveName, $vars);

 

?>
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s