/** * Constructor * @param mixed The input source. Can be a file or a string * @param string The filename to use, optional * @param string The MIME type to use, optional * @param string The Content-ID to use, optional * @param string The encoding format to use, optional */ public function __construct($data = null, $name = null, $type = "application/octet-stream", $cid = null, $encoding = "base64") { parent::__construct($data, $name, $type, $encoding, "inline"); if ($cid === null) { $cid = self::generateFileName("swift-" . uniqid(time()) . "."); $cid = urlencode($cid) . "@" . (!empty($_SERVER["SERVER_NAME"]) ? $_SERVER["SERVER_NAME"] : "swift"); } $this->setContentId($cid); if ($name === null && !$data instanceof Swift_File) { $this->setFileName($cid); } $this->headers->set("Content-Description", null); }