I have following email controller in my custom module not sending emails. when I print the $params arrays it giving the output not email is not sending. Please check and let me know what is wrong with this
public function sendemailAction()
{ $params = $this->getRequest()->getParams();
print_r($params);
$body = '<h3>Contact Form</h3><p>Hello,</p>
<p>We have received this message from the website:</p>
<p><b>Name:</b> ' . ($params['name']) . '<br>
<p><b>Email:</b> ' . ($params['email']) . '<br>
<b>Comments:</b> ' . ($params['comment']) . '</p>';
$mail = new Zend_Mail();
$mail->setBodyHtml($body);
$mail->setFrom($params['email'], $params['name']);
$mail->addTo('test@test.com');
$mail->setSubject('Contact Form');
try {
$mail->send();
}
catch(Exception $ex)
{
Mage::getSingleton('core/session')->addError('Unable to send email. Sample of a custom notification error from Contact Us Form.');
} $this->_redirect('reviews/');
}