Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP5.2中获取电子邮件附件的Mime类型(imap_fetchmime等效)_Php_Email_Imap_Mime Types_Mime - Fatal编程技术网

PHP5.2中获取电子邮件附件的Mime类型(imap_fetchmime等效)

PHP5.2中获取电子邮件附件的Mime类型(imap_fetchmime等效),php,email,imap,mime-types,mime,Php,Email,Imap,Mime Types,Mime,这个问题以前提过,但用户没有给出完整的解决方案,所以我想知道是否有其他人可以帮忙 我需要能够抓取附件的MIME类型,这些附件是我的脚本正在从邮箱读取的电子邮件的一部分 我有下面的代码工作良好,问题是它需要运行的服务器无法升级(尚未)到PHP5.3.6,所以我需要一个等效的或另一个解决方法 $attachments = Array(); for ($j=0;$j<sizeof($selectBoxDisplay);$j++) { $attac

这个问题以前提过,但用户没有给出完整的解决方案,所以我想知道是否有其他人可以帮忙

我需要能够抓取附件的MIME类型,这些附件是我的脚本正在从邮箱读取的电子邮件的一部分

我有下面的代码工作良好,问题是它需要运行的服务器无法升级(尚未)到PHP5.3.6,所以我需要一个等效的或另一个解决方法

   $attachments = Array();
   for ($j=0;$j<sizeof($selectBoxDisplay);$j++) 
   {        
       $attachments["emailedDocument".$j]["name"] = $selectBoxDisplay[$j];
       $attachments["emailedDocument".$j]["content"] = imap_base64(imap_fetchbody($mbox,$msgno,$j+2));

       $mime_headers = imap_fetchmime($mbox,$msgno,$j+2);
       $contenttype = "Content-Type: ";
       $contenttypepos = strpos($mime_headers, $contenttype);
       $semicolon = strpos($mime_headers, ";");
       $attachments["emailedDocument".$j]["type"] = substr($mime_headers, $contenttypepos + strlen($contenttype), $semicolon - strlen($contenttype));

       // attachment filesize is the number of bytes in the content string
       $attachments["emailedDocument".$j]["size"] = strlen($attachments["emailedDocument".$j]["content"]);
   }
$attachments=Array();
对于($j=0;$j)