protected function getHeaders(array $customHeaders = array())
    {
        $timestamp = $this->getTimestamp();
        
        $subject = trim($this->subject);
        $subject = str_replace(array("\n", "\r"), '', $subject);
        
        $to = $cc = $bcc = array();
        foreach ($this->to as $email => $name) {
            $to[] = trim($name.' <'.$email.'>');
        }
        
        foreach ($this->cc as $email => $name) {
            $cc[] = trim($name.' <'.$email.'>');
        }
        
        foreach ($this->bcc as $email => $name) {
            $bcc[] = trim($name.' <'.$email.'>');
        }
        
        list($account, $suffix) = explode('@', $this->username);
        
        $headers = array(
            'Date'          => $timestamp,
            'Subject'       => $subject,
            'From'          => '<'.$this->username.'>',
            'To'            => implode(', ', $to)
        );
        
        if (!empty($cc)) {
            $headers['Cc'] = implode(', ', $cc);
        }
        
        if (!empty($bcc)) {
            $headers['Bcc'] = implode(', ', $bcc);
        }
        
        $headers['Message-ID']  = '<'.md5(uniqid(time())).'.wslimphp@'.$suffix.'>';
        
        $headers['Thread-Topic'] = $this->subject;
        
        $headers['Reply-To'] = '<'.$this->username.'>';
        
        foreach ($customHeaders as $key => $value) {
            $key = explode('-', $key);
            $key = implode('-', array_map(function ($value) {
                return ucfirst(strtolower($value));
            }, $key));
                $headers[$key] = $value;
        }
        
        return $headers;
    }
protected function getHeaders(array $customHeaders = array())
    {
        $timestamp = $this->getTimestamp();
        
        $subject = trim($this->subject);
        $subject = str_replace(array("\n", "\r"), '', $subject);
        
        $to = $cc = $bcc = array();
        foreach ($this->to as $email => $name) {
            $to[] = trim($name.' <'.$email.'>');
        }
        
        foreach ($this->cc as $email => $name) {
            $cc[] = trim($name.' <'.$email.'>');
        }
        
        foreach ($this->bcc as $email => $name) {
            $bcc[] = trim($name.' <'.$email.'>');
        }
        
        list($account, $suffix) = explode('@', $this->username);
        
        $headers = array(
            'Date'          => $timestamp,
            'Subject'       => $subject,
            'From'          => '<'.$this->username.'>',
            'To'            => implode(', ', $to)
        );
        
        if (!empty($cc)) {
            $headers['Cc'] = implode(', ', $cc);
        }
        
        if (!empty($bcc)) {
            $headers['Bcc'] = implode(', ', $bcc);
        }
        
        $headers['Message-ID']  = '<'.md5(uniqid(time())).'.wslimphp@'.$suffix.'>';
        
        $headers['Thread-Topic'] = $this->subject;
        
        $headers['Reply-To'] = '<'.$this->username.'>';
        
        foreach ($customHeaders as $key => $value) {
            $key = explode('-', $key);
            $key = implode('-', array_map(function ($value) {
                return ucfirst(strtolower($value));
            }, $key));
                $headers[$key] = $value;
        }
        
        return $headers;
    }
protected function getHeaders ( array $ customHeaders = array ( ) ) { $ timestamp = $ this -> getTimestamp ( ) ; $ subject = trim ( $ this -> subject ) ; $ subject = str_replace ( array ( "\n" , "\r" ) , '' , $ subject ) ; $ to = $ cc = $ bcc = array ( ) ; foreach ( $ this -> to as $ email => $ name ) { $ to [ ] = trim ( $ name . ' <' . $ email . '>' ) ; } foreach ( $ this -> cc as $ email => $ name ) { $ cc [ ] = trim ( $ name . ' <' . $ email . '>' ) ; } foreach ( $ this -> bcc as $ email => $ name ) { $ bcc [ ] = trim ( $ name . ' <' . $ email . '>' ) ; } list ( $ account , $ suffix ) = explode ( '@' , $ this -> username ) ; $ headers = array ( 'Date' => $ timestamp , 'Subject' => $ subject , 'From' => '<' . $ this -> username . '>' , 'To' => implode ( ', ' , $ to ) ) ; if ( ! empty ( $ cc ) ) { $ headers [ 'Cc' ] = implode ( ', ' , $ cc ) ; } if ( ! empty ( $ bcc ) ) { $ headers [ 'Bcc' ] = implode ( ', ' , $ bcc ) ; } $ headers [ 'Message-ID' ] = '<' . md5 ( uniqid ( time ( ) ) ) . '.wslimphp@' . $ suffix . '>' ; $ headers [ 'Thread-Topic' ] = $ this -> subject ; $ headers [ 'Reply-To' ] = '<' . $ this -> username . '>' ; foreach ( $ customHeaders as $ key => $ value ) { $ key = explode ( '-' , $ key ) ; $ key = implode ( '-' , array_map ( function ( $ value ) { return ucfirst ( strtolower ( $ value ) ) ; } , $ key ) ) ; $ headers [ $ key ] = $ value ; } return $ headers ; }
Returns the header information

@param array $customHeaders Custom headers to include

@return array
Returns the header information