echo "附件下载成功\r\n"; $atpath.= $mailAttach[0]; $mailinfo['attachname'] = $mailAttach[0]; $mailinfo['attachpath'] = $atpath; imap_clearflag_full($connect,$message_id , '\\Seen',ST_UID); } else { echo "附件下载失败或者该邮件没有附件\r\n"; } */ echo "存储开始\r\n"; if ($msg_obj->getMsgId($mailinfo['message_id'])) { echo "已经存储过了\r\n"; continue; } if (write_w_file($path . $fname, $body)) { echo "邮件存储成功\r\n"; if ($msg_obj->insertMessages($mailinfo)) { echo "写入数据库成功!\r\n"; $lasttime = $mailinfo['sendtime']; echo "\r\n"; } else { echo "写入数据库失败!\r\n"; } } else { echo '邮件存储失败'; } } echo "本次抓取的最后一封邮件发送时间是" . date('Y-m-d H:i:s', $lasttime); echo $ac['gmail'] . " 连接断开\r\n"; echo '***********************わだぃわかわいのxzysaberです**************************' . "\n"; $mail->closeMail(); }