/**
  * Try to send Outbox entry
  *
  * @param Gpf_Data_Record $mail
  */
 private function sendMail(Gpf_Data_Record $outbox)
 {
     //build mail
     $mail = new Gpf_Mail();
     //set transfer method (smtp or mail)
     if ($outbox->get('use_smtp') == Gpf::YES) {
         if ($outbox->get('smtp_ssl') == Gpf::YES) {
             $this->checkSSL();
         }
         $mail->setTransferMethod('smtp');
         $mail->setTransferParams(array('host' => $outbox->get('smtp_server'), 'port' => $outbox->get('smtp_port'), 'auth' => $outbox->get('smtp_auth') == Gpf::YES ? strlen($outbox->get('smtp_auth_method')) ? $outbox->get('smtp_auth_method') : true : false, 'username' => $outbox->get('smtp_username'), 'password' => $outbox->get('smtp_password'), 'localhost' => 'localhost', 'timeout' => 30, 'verp' => false, 'debug' => false, 'persist' => false));
     } else {
         $mail->setTransferMethod('mail');
         $mail->setTransferParams(null);
     }
     $mail->setRecipients($outbox->get('to_recipients'));
     $mail->setCcRecipients($outbox->get('cc_recipients'));
     $mail->setBccRecipients($outbox->get('bcc_recipients'));
     $mail->setFullFromAddress($outbox->get('from_mail'));
     $mail->setHtmlBody($outbox->get('body_html'));
     $mail->setTxtBody($outbox->get('body_text'));
     if ($outbox->get('reply_to') != '') {
         $mail->setFrom('', $outbox->get('from_mail'));
         $mail->setReplyTo($outbox->get('reply_to'));
     } else {
         $mail->setReplyTo($outbox->get('from_mail'));
     }
     $mail->setSubject($outbox->get('subject'));
     $mail->setUserAgent('Quality Unit Mail Services');
     //add attachments and inner images
     $attachments = Gpf_Db_Table_MailAttachments::getMailAttachments($outbox->get('mailid'));
     foreach ($attachments as $attachment) {
         if ($attachment->get('is_included_image') == Gpf::YES) {
             $mail->addImage($attachment->get('filename'), Gpf_Db_Table_FileContents::getFileContent($attachment->get('fileid')), $attachment->get('filetype'));
         } else {
             $mail->addAttachment($attachment->get('filename'), $attachment->get('filetype'), Gpf_Db_Table_FileContents::getFileContent($attachment->get('fileid')));
         }
     }
     $mail->send();
     return true;
 }