src/Mailer/Email.php
protected function _getMime($filename, $default = 'application/octet-stream') {
		if (!isset($this->_Mime)) {
			$this->_Mime = new Mime();
		}
		$mime = $this->_Mime->detectMimeType($filename);
		// Some environments falsely return the default too fast, better fallback to extension here
		if (!$mime || $mime === $default) {
			$ext = pathinfo($filename, PATHINFO_EXTENSION);
			$mime = $this->_Mime->getMimeTypeByAlias($ext);
		}
		return $mime;
	}
protected function _getMime($filename, $default = 'application/octet-stream') {
		if (!isset($this->_Mime)) {
			$this->_Mime = new Mime();
		}
		$mime = $this->_Mime->detectMimeType($filename);
		// Some environments falsely return the default too fast, better fallback to extension here
		if (!$mime || $mime === $default) {
			$ext = pathinfo($filename, PATHINFO_EXTENSION);
			$mime = $this->_Mime->getMimeTypeByAlias($ext);
		}
		return $mime;
	}
protected function _getMime ( $ filename , $ default = 'application/octet-stream' ) { if ( ! isset ( $ this -> _Mime ) ) { $ this -> _Mime = new Mime ( ) ; } $ mime = $ this -> _Mime -> detectMimeType ( $ filename ) ; // Some environments falsely return the default too fast, better fallback to extension here if ( ! $ mime || $ mime === $ default ) { $ ext = pathinfo ( $ filename , PATHINFO_EXTENSION ) ; $ mime = $ this -> _Mime -> getMimeTypeByAlias ( $ ext ) ; } return $ mime ; }
Try to find mimetype by file extension

@param string $filename File name
@param string $default default MimeType
@return string Mimetype (falls back to `application/octet-stream`)
Try to find mimetype by file extension