It took me a little while to figure out to solve a standard problem like sending an template or view script as email, the main problem is the original documentation doesn´t show anything about it, just sending email with text from a string, and if you search on the web, you find mostly the same thing or solutions which were not satisfying me.
//Rendering mail template to string
$mail_view = new Zend_View();
$mail_view = new Zend_View();
/<strong>
</strong> This will only work inside the MVC vontroller and
<strong> handle over script path to the email view renderer
</strong>/
$mail_view->addScriptPath($this->view->getScriptPaths());
$strMailBody=$mail_view->render('controllername/mail.phtml');
//configuring email
$email_recipient_mail="recipient@example.com";
$email_recipient_name="Recipient Name";
$email_subject="Subject for the Email";
$email_sender_email="sender@example.com";
$email_sender_name="Sender Name";
//sending email with Zend_Mail()
$mail = new Zend_Mail ();
$mail->setFrom ($email_sender_email, $email_sender_email);
$mail->addTo ($email_recipient_mail, $email_recipient_name);
$mail->setSubject($email_subject);
$mail->setBodyText($strMailBody);
$mail->send ();
The mail Template "mail.phtml" could contain text or HTML.
Finally i choosed out this method as the best for sending email in Zend Framework Projects,
maybe there would be one more better way, if i could put the subject inside the template file, i gonna save that for later.