Social Icons

twitterfacebookgoogle pluslinkedinemail

Wednesday 10 April 2013

How to send mail from magento

you can send custom mail from magento. its very easy to send mail from magento just write below code and modify as your requirement

Send mail from magento

 

$mail = Mage::getModel('core/email');
$mail->setToName('Your Name');
$mail->setToEmail('Youe Email');
$mail->setBody('Mail Text / Mail Content');
$mail->setSubject('Mail Subject');
$mail->setFromEmail('Sender Mail Id');
$mail->setFromName("Msg to Show on Subject");
$mail->setType('html');// YOu can use Html or text as Mail format
$mail->send();
?>

also you can use

$emailTemplate  = Mage::getModel('core/email_template')->load(1);   //1  isTransactional Emails id
$emailTemplate->setSenderEmail('anantprajapati111@gmail.com');
$emailTemplate->setSenderName('Anant');
$emailTemplate->send('test@gmail.com','Anu', '');

if you want to more info, click on belove link
http://stackoverflow.com/questions/5595202/sending-e-mail-programmatically-in-magento-is-failing

2 comments :

  1. This comment has been removed by the author.

    ReplyDelete
  2. Great Read! I am impressed on how you make your article easy to understand. I'll come back for more :D

    Japs Buidon is a Social Media Specialist and belongs to a team of Magento Developer in Florida. For more tutorial and tips you can follow him here -> alwaysopencommerce.com

    ReplyDelete

 

Free Advertisement

Free Advertisement

Free Advertisement

Free Advertisement