I created a simple form to store the data in the database which is working perfectly. In that there is a email field for which an email needs to be sent automatically.
In Indexcontroller.php
public function createPersonAction()
{
$data = $this->getRequest()->getPost();
$session = Mage::getSingleton('core/session');
$person = Mage::getModel('lesson14/lesson14');
$person->setData('name', $data['name']);
$person->setData('birthday', $data['birthday']);
$person->setData('gender', $data['gender']);
$person->setData('address', $data['address']);
$person->setData('email',$data['email']);
// $person->setData($data);
try{
$person->save();
$session->addSuccess('Person Added sucessfully');
}catch(Exception $e){
$session->addError('Add Error');
}
now while saving an email needs to be sent to the email that is given in the field.