我似乎无法将我的邮件消息移动到保存的文件夹中。这是我的代码:
当我运行这个脚本时,什么都没有发生。消息仍然在收件箱中。有什么想法吗?谢谢!
$mbox = imap_open("{".$mail_server.":".$mail_port."}".$mail_folder,
$mail_username, $mail_password) or die("Error opening mailbox: ".imap_last_error());
$countnum = imap_num_msg($mbox);
$msglist = array();
if( $countnum > 0 ) {
$num = 1;
while ($num <= $countnum) {
$msglist[] = $num;
$num++;
}//end while loop
}
//move the email to our saved folder
imap_mail_move($mbox,implode(',',$msglist),'INBOX/Saved');
imap_expunge($mbox);
imap_close($mbox);
当我运行这个脚本时,什么都没有发生。消息仍然在收件箱中。有什么想法吗?谢谢!
if($imapresult==false){die(imap_last_error());}
需要一些错误来处理。 - Lawrence CheroneINBOX/Saved
更改为INBOX.Saved
,并在比较布尔变量时使用3个===
。只是为了保持答案100%正确,让其他人使用。我会非常感激 ^.^ - 131