WordPress – Warning: Cannot modify header information – headers already sent

I’m getting an error during a fresh wordpress installation stating:

Warning: Cannot modify header information - headers already sent by (output started at /www/99k.org/r/e/a/realestatedemo/htdocs/wp-includes/class-phpmailer.php:514) in /www/99k.org/r/e/a/realestatedemo/htdocs/wp-includes/pluggable.php on line 896

The problem is the issue is almost always due to blank space in the PHP file however I do not seem to have any. I’m wondering if this could be an issue with the server/hosting I’m using: Zymic.com

Read More

The error references class-phpmailer.php:514 which is shown on the line below:

  $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($subject)), $body, $header);

in this section of the code:

  private function mail_passthru($to, $subject, $body, $header, $params) {
    if ( ini_get('safe_mode') || !($this->UseSendmailOptions) ) {
        $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($subject)), $body, $header);
    } else {
        $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($subject)), $body, $header, $params);
    }
    return $rt;
  }

P.S.

I have already attempted the check for whitespace in notepad++ as mentioned here:

How to fix “Headers already sent” error in PHP

and I don’t see any reference to Print or echo near that line (as suggested in the SO post above) either.

Related posts

Leave a Reply

1 comment

  1. Check whether there is any space between appended scripts or script sections:

    ?>
       // Blank space here
    <?php
    

    Meanwhile use can use ob_start(); function till you figure out the issue