Configure Gmail SMTP in Bootstrap _initAutoload()


$config = array('ssl' => 'ssl',
                'auth' => 'login',
                'port' => 465,
                'username' => 'YOUR USERNAME',
                'password' => 'YOUR PASSWORD');

$transport=new Zend_Mail_Transport_Smtp('smtp.gmail.com', $config);
Zend_Mail::setDefaultTransport($transport);

Send Email with text and html template


    $mail=new Zend_Mail();
    
    $mail->setFrom($fromEmail);
    $mail->addTo($userEmail,"{$firstName} {$lastName}");
    $mail->setSubject($subject);

    include "_e-mail.phtml";
    $mail->setBodyText($email);

    include "_html_e-mail.phtml";
    $mail->setBodyHtml($htmlbody);

    $mail->send();