title: php mail() error_get_last();
body: <p>I cannot figure out my mistake. Hopefully you guys can help.</p>
  
  <pre><code>        $receiver = 'myemail@domain.tld';
          $msg = 'some text goes here';
  
          $msg = wordwrap($msg, 70);
  
          $subject =  'Email Test';
  
          $headers =  'From: email@domain.tld' . PHP_EOL . 
                      'Reply-To: email@domain.tld' . PHP_EOL . 
                      'MIME-Version: 1.0' . PHP_EOL . 
                      'Content-Type: text/html; charset=ISO-8859-1';
  
          echo ($receiver . ' ' . $subject . ' ' . $msg . ' ' . $headers);
  
          if(!mail($receiver, $subject, $msg, $headers)){
  
              error_reporting(0);
  
              echo ('&lt;pre&gt;' . date("Y-m-d H:i:s") . ': ');
  
              var_dump (error_get_last());
              echo ('&lt;br /&gt;');
              print_r (error_get_last());
  
              echo ('&lt;/pre&gt;');
  
          }else{ /* Redirect to another page */ }
  </code></pre>
  
  <p>So if i call submit.php i get the following message: 2015-02-24 10:06:50: NULL</p>
  
  <p>I really don't undersand why. no log is filled with errors. 
  I also tried error_reporting(E_ERROR | E_WARNING | E_PARSE); bit it stays null</p>