src/sb/Email/Writer.php
private function logEmail($email, $sent)
    {

        $message = "\nEmail sent at " . date('m/d/y h:i:s');
        $message .= "\nFrom:" . $email->from . '@' . $this->remote_addr;
        $message .= "\nTo: " . $email->to;
        foreach ($email->cc as $cc) {
            $message .="\nCc:" . $cc;
        }
        foreach ($email->bcc as $bcc) {
            $message .="\nBcc:" . $bcc;
        }
        $message .= "\nSubject: " . $email->subject;
        $message .= "\nAttachments: " . count($email->attachments) . ' ';
        if ($this->log_body) {
            $message .= "\nBody: " . $email->body;
            $message .= "\nBody_HTML: " . $email->body_HTML;
        }

        $names = Array();
        foreach ($email->attachments as $attachment) {
            $names[] = $attachment->name;
        }

        $message .= "(" . \implode(",", $names) . ")";

        if ($sent) {
            return $this->logger->sbEmailWriterSent($message);
        } else {
            return $this->logger->sbEmailWriterError($message);
        }
    }
private function logEmail($email, $sent)
    {

        $message = "\nEmail sent at " . date('m/d/y h:i:s');
        $message .= "\nFrom:" . $email->from . '@' . $this->remote_addr;
        $message .= "\nTo: " . $email->to;
        foreach ($email->cc as $cc) {
            $message .="\nCc:" . $cc;
        }
        foreach ($email->bcc as $bcc) {
            $message .="\nBcc:" . $bcc;
        }
        $message .= "\nSubject: " . $email->subject;
        $message .= "\nAttachments: " . count($email->attachments) . ' ';
        if ($this->log_body) {
            $message .= "\nBody: " . $email->body;
            $message .= "\nBody_HTML: " . $email->body_HTML;
        }

        $names = Array();
        foreach ($email->attachments as $attachment) {
            $names[] = $attachment->name;
        }

        $message .= "(" . \implode(",", $names) . ")";

        if ($sent) {
            return $this->logger->sbEmailWriterSent($message);
        } else {
            return $this->logger->sbEmailWriterError($message);
        }
    }
private function logEmail ( $ email , $ sent ) { $ message = "\nEmail sent at " . date ( 'm/d/y h:i:s' ) ; $ message .= "\nFrom:" . $ email -> from . '@' . $ this -> remote_addr ; $ message .= "\nTo: " . $ email -> to ; foreach ( $ email -> cc as $ cc ) { $ message .= "\nCc:" . $ cc ; } foreach ( $ email -> bcc as $ bcc ) { $ message .= "\nBcc:" . $ bcc ; } $ message .= "\nSubject: " . $ email -> subject ; $ message .= "\nAttachments: " . count ( $ email -> attachments ) . ' ' ; if ( $ this -> log_body ) { $ message .= "\nBody: " . $ email -> body ; $ message .= "\nBody_HTML: " . $ email -> body_HTML ; } $ names = Array ( ) ; foreach ( $ email -> attachments as $ attachment ) { $ names [ ] = $ attachment -> name ; } $ message .= "(" . \ implode ( "," , $ names ) . ")" ; if ( $ sent ) { return $ this -> logger -> sbEmailWriterSent ( $ message ) ; } else { return $ this -> logger -> sbEmailWriterError ( $ message ) ; } }
Logs the sending of emails if logging is enable by specifying the log_file property

@param $email \sb\Email
@param $sent Boolean, was the email sent or not
Logs the sending of emails if logging is enable by specifying the log_file property