php - Bad Message number error in imap_fetchbody function -


i have code search though emails & if particular string found, stuff done. below code:

$date = date( "d-m-y", strtotime( "-1 days" )); $email=imap_search($inbox, 'subject "undelivered mail returned sender" since        "'.$date.'"', se_uid); if($email){ foreach($email $email_number) {     $overview = imap_fetch_overview($inbox,$email_number,0);     $message = imap_fetchbody($inbox,$email_number,1); /* line 18 */ 

this code gives me following error:

warning: imap_fetchbody() [function.imap-fetchbody]: bad message number in /home/public_html/example.com/check_invalid_email.php on line 18 

now on above code if change subject this:

$email=imap_search($inbox, 'subject "mail delivery failed" since        "'.$date.'"', se_uid); 

it works charm this. information there emails both subjects. i've not included whole code, please consider alright changing 1 line gives me desired results. this? i'm not able find out cause of it.

i think have use getting key,value array

foreach($email $key=>$email_number) { 

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -