_getNewForm(); if ($form->validate()) { $formData = $form->getValues(); $body = $this->_getEmailBody(); $mail = new Qs_Mail(); $mail->setFrom(App_Settings_Obj::get('siteFrom')); $mail->addTo($formData['recipientEmail'], $formData['recipientName']); $mail->setSubject('--- Test Html Email ---'); Qs_Mail::cutImageBaseUrl($body, constant('BASE_URL')); $mail->setHtml($body, null, constant('WWW_PATH')); $mail->setType(Zend_Mime::MULTIPART_RELATED); $result = $mail->send(); echo 'Email sent to: ' . implode(', ', $result->getRecipients()); exit(); } $this->_addFormItem($form); return $this; } protected function _getEmailBody() { $html = '' . '' . '

Test Email

' . ''; return $html; } protected function _getNewForm(array $options = array()) { $options = array_merge($options, $this->_getFormOptions()); $form = new Qs_Form($options); $form->addElement('hidden', 'action', array('value' => 'insert')); $this->_bindFormFields($form); return $form; } protected function _bindFormFields(Qs_Form $form) { $form->addElement('text', 'recipientEmail', array('label' => 'Recipient Email', 'required' => true)); $form->getElement('recipientEmail')->addValidator('EmailAddress'); $form->addElement('text', 'recipientName', array('label' => 'Recipient Name')); return $this; } }