Swift_Mime_SimpleMimeEntity::fixHeaders PHP Method

fixHeaders() protected method

Re-evaluate what content type and encoding should be used on this entity.
protected fixHeaders ( )
    protected function fixHeaders()
    {
        if (count($this->immediateChildren)) {
            $this->setHeaderParameter('Content-Type', 'boundary', $this->getBoundary());
            $this->headers->remove('Content-Transfer-Encoding');
        } else {
            $this->setHeaderParameter('Content-Type', 'boundary', null);
            $this->setEncoding($this->encoder->getName());
        }
    }

Usage Example

Beispiel #1
0
 /** Fix the content-type and encoding of this entity */
 protected function fixHeaders()
 {
     parent::fixHeaders();
     if (count($this->getChildren())) {
         $this->setHeaderParameter('Content-Type', 'charset', null);
         $this->setHeaderParameter('Content-Type', 'format', null);
         $this->setHeaderParameter('Content-Type', 'delsp', null);
     } else {
         $this->setCharset($this->userCharset);
         $this->setFormat($this->userFormat);
         $this->setDelSp($this->userDelSp);
     }
 }