public function addHeader($key, $value) {
    if (!is_string($key)) {
      $error = sprintf("Header key is not a string (Actual type: %s).",
                       gettype($key));
      throw new \InvalidArgumentException($error);
    }
    $this->addHeaderArray(array($key => $value));
  }
public function addHeader($key, $value) {
    if (!is_string($key)) {
      $error = sprintf("Header key is not a string (Actual type: %s).",
                       gettype($key));
      throw new \InvalidArgumentException($error);
    }
    $this->addHeaderArray(array($key => $value));
  }
public function addHeader ( $ key , $ value ) { if ( ! is_string ( $ key ) ) { $ error = sprintf ( "Header key is not a string (Actual type: %s)." , gettype ( $ key ) ) ; throw new \ InvalidArgumentException ( $ error ) ; } $ this -> addHeaderArray ( array ( $ key => $ value ) ) ; }
Adds a header pair to the mail object.

@param string $key Header name (from the whitelist) to be added.
@param string $value Header value to be added.
@throws \InvalidArgumentException If the header is not on the whitelist, or
if the header is invalid (i.e. not a string).
Adds a header pair to the mail object .