Example #1
0
 /**
  * Internal method for applying the settings from this MIME encoder to another
  * MIME encoder
  *
  * @param \r8\Transform\MIME $dest The encoder to apply the settings to
  * @return \r8\Transform\MIME Returns the input object
  */
 public function apply(\r8\Transform\MIME $dest)
 {
     $dest->setLineLength($this->getLineLength());
     $dest->setHeader($this->getHeader());
     $dest->setInputEncoding($this->getInputEncoding());
     $dest->setOutputEncoding($this->getOutputEncoding());
     $dest->setEOL($this->getEOL());
     return $dest;
 }
Example #2
0
 /**
  * Clears a custom header from this instance
  *
  * @param String $header The header to remove
  * @return \r8\Mail Returns a self reference
  */
 public function removeCustomHeader($header)
 {
     $header = \r8\Transform\MIME::stripHeaderName($header);
     if (\r8\isEmpty($header)) {
         throw new \r8\Exception\Argument(0, 'Header Name', 'Must not be empty');
     }
     if (isset($this->headers[$header])) {
         unset($this->headers[$header]);
     }
     return $this;
 }
Example #3
0
 public function testStripHeaderName()
 {
     $chars = implode("", array_map('chr', range(1, 255)));
     $this->assertSame('!"#$%&\'()*+,-./0123456789;<=>?@ABCDEFGHIJKLMNOP' . 'QRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~', \r8\Transform\MIME::stripHeaderName($chars));
 }