Index: branches/5.3.x/core/kernel/utility/email.php =================================================================== diff -u -N -r16111 -r16320 --- branches/5.3.x/core/kernel/utility/email.php (.../email.php) (revision 16111) +++ branches/5.3.x/core/kernel/utility/email.php (.../email.php) (revision 16320) @@ -1,6 +1,6 @@ _processRecipients(); $this->_changeLanguage(false); + // 1. set headers + try { + $message_headers = $this->_getHeaders(); + } + catch ( Exception $e ) { + return $this->setError('Error parsing e-mail message headers'); + } + + $message_subject = isset($message_headers['Subject']) ? $message_headers['Subject'] : 'Mail message'; + $this->sender->SetSubject($message_subject); + + foreach ( $message_headers as $header_name => $header_value ) { + $this->sender->SetEncodedHeader($header_name, $header_value); + } + if ( $this->_storeEmailLog() ) { // 1. prepare log $this->logData = Array ( 'From' => $this->fromName . ' (' . $this->fromEmail . ')', 'To' => $this->toName . ' (' . $this->toEmail . ')', 'OtherRecipients' => serialize($this->recipients), + 'Subject' => $message_subject, 'Status' => EmailLogStatus::SENT, 'ErrorMessage' => '', 'SentOn' => TIMENOW, @@ -262,25 +278,6 @@ $this->params['email_access_key'] = $this->_generateAccessKey(); } - // 1. set headers - try { - $message_headers = $this->_getHeaders(); - } - catch ( Exception $e ) { - return $this->setError('Error parsing e-mail message headers'); - } - - $message_subject = isset($message_headers['Subject']) ? $message_headers['Subject'] : 'Mail message'; - $this->sender->SetSubject($message_subject); - - foreach ($message_headers as $header_name => $header_value) { - $this->sender->SetEncodedHeader($header_name, $header_value); - } - - if ( $this->_storeEmailLog() ) { - $this->logData['Subject'] = $message_subject; - } - // 3. set body try { $html_message_body = $this->_getMessageBody(true);