Author: Chris Corbyn
Inheritance: implements Swift_Mime_MimeEntity
示例#1
0
 /**
  * Create a new Attachment with $headers, $encoder and $cache.
  *
  * @param Swift_Mime_HeaderSet      $headers
  * @param Swift_Mime_ContentEncoder $encoder
  * @param Swift_KeyCache            $cache
  * @param Swift_Mime_Grammar        $grammar
  * @param array                     $mimeTypes optional
  */
 public function __construct(Swift_Mime_HeaderSet $headers, Swift_Mime_ContentEncoder $encoder, Swift_KeyCache $cache, Swift_Mime_Grammar $grammar, $mimeTypes = array())
 {
     parent::__construct($headers, $encoder, $cache, $grammar);
     $this->setDisposition('attachment');
     $this->setContentType('application/octet-stream');
     $this->_mimeTypes = $mimeTypes;
 }
示例#2
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);
     }
 }