This commit is contained in:
wangjinlei
2022-06-21 17:24:06 +08:00
parent 7016414402
commit d1e973388a
8 changed files with 633 additions and 283 deletions

View File

@@ -50,47 +50,47 @@ class Inbox extends Controller{
$insertData=[];
foreach ($emailNums as $key=>$value){
// foreach ($emailNums as $key=>$value){
//2.1 获取邮件头部信息
$head = $server->getHeaders($value);
// //2.1 获取邮件头部信息
// $head = $server->getHeaders($value);
//2.2 处理邮件附件
$files = $server->getAttach($value);
// 附件
$head['url'] =[];
// //2.2 处理邮件附件
// $files = $server->getAttach($value);
// // 附件
// $head['url'] =[];
//2.3 处理正文中的图片
$imageList=array();
$section = 2;
if($files){
foreach($files as $k => $file)
{
// //2.3 处理正文中的图片
// $imageList=array();
// $section = 2;
// if($files){
// foreach($files as $k => $file)
// {
//type=1为附件,0为邮件内容图片
if($file['type'] == 0)
{
$imageList[$k]=$file['pathname'];
}
// //type=1为附件,0为邮件内容图片
// if($file['type'] == 0)
// {
// $imageList[$k]=$file['pathname'];
// }
if($file['type'] == 1)
{
array_push($head['url'],$file['url']);
}
// if($file['type'] == 1)
// {
// array_push($head['url'],$file['url']);
// }
if(($file['type'] == 0 || $file['type'] == 1) && !empty($file['url'])){
// if(($file['type'] == 0 || $file['type'] == 1) && !empty($file['url'])){
$section = 1.2 ;
}
// $section = 1.2 ;
// }
}
}
// }
// }
$webPath = ROOT_PATH.'public' . DS . 'contentImg' . DS . date('Ymd') .DS ;
// 正文内容
$head['content'] = $server->getBody($value,$webPath,$imageList,$section);
array_push($insertData,$head);
}
// $webPath = ROOT_PATH.'public' . DS . 'contentImg' . DS . date('Ymd') .DS ;
// // 正文内容
// $head['content'] = $server->getBody($value,$webPath,$imageList,$section);
// array_push($insertData,$head);
// }
$this->insertData($insertData,$journal);
}