I need to insert a form into one tab contained into product page.
you can see an example in this page

I created a static block that contain the form, the action is a cms page.

so, I need to insert a php function that send me the data insert into the form.

How can I do this action?

closed as too broad by sv3n, Jai, Dhiren Vasoya, Priyank, Piyush Nov 2 '18 at 6:01

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.


Set your action of form as

<form action="<?php echo $this->getUrl('module/controller/method'); ?>" >

Then create a controller with the corresponding method.

function Name(){
if ($data = $this->getRequest()->getPost()) {

    $model = Mage::getModel('module/model_name');
    try {
    }catch (Exception $e) {

To send email do following

$translate = Mage::getSingleton('core/translate');

            /* @var $translate Mage_Core_Model_Translate */


            try {               

                $postObject = new Varien_Object();


                $mailTemplate = Mage::getModel('core/email_template');

                /* @var $mailTemplate Mage_Core_Model_Email_Template */

                $mailTemplate->setDesignConfig(array('area' => 'frontend'))                 
                        'receiver_email_id', null, array('data' => $postObject)


            } catch (Exception $e) {


  • thanks for the reply, I need to insert the php function mail and can you explain well your solution please? I'm a magento newbie :( – Mma87 Jul 2 '14 at 14:25
  • You can use zend mail function for your magento form. – Ann Mary Jul 3 '14 at 9:12

Try this

    $mail = new Zend_Mail();
    $mail->setBodyHtml(" body text"); 
}catch(Exception $e){
    echo $e->getMassage(); 

Hope,It may work for you..

Not the answer you're looking for? Browse other questions tagged or ask your own question.