public function preDispatch()
 {
     parent::preDispatch();
     Mage::getSingleton('core/session', array("name" => "frontend"))->setFromEmail('1');
     /* @var $helper Mage_Sendfriend_Helper_Data */
     $helper = Mage::helper('sendfriend');
     /* @var $session Mage_Customer_Model_Session */
     $session = Mage::getSingleton('customer/session');
     if (!$helper->isEnabled()) {
         $this->norouteAction();
         return $this;
     }
     if (!$helper->isAllowForGuest() && !$session->authenticate($this)) {
         $this->setFlag('', self::FLAG_NO_DISPATCH, true);
         if ($this->getRequest()->getActionName() == 'sendemail') {
             $session->setBeforeAuthUrl(Mage::getUrl('*/*/send', array('_current' => true)));
             Mage::getSingleton('catalog/session')->setSendfriendFormData($this->getRequest()->getPost());
         }
     }
     return $this;
 }