Helper\Mailer\Smtp::getMIMEType PHP Method

getMIMEType() protected method

获取附件MIME类型
protected getMIMEType ( string $file ) : mixed
$file string 文件
return mixed
    protected function getMIMEType($file)
    {
        if (file_exists($file)) {
            $mime = mime_content_type($file);
            /*if(! preg_match("/gif|jpg|png|jpeg/", $mime)){
                  $mime = "application/octet-stream";
              }*/
            return $mime;
        } else {
            return false;
        }
    }