★ wanayoo — archive 1999 http://www.php.net/manual/function.imap-delete.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to IMAP
Quick Reference
German version of this pageJapanese version of this pageItalian version of this pageFrench version of this pageHungarian version of this page
IMAP
* imap_append
* imap_base64
* imap_body
* imap_check
* imap_close
* imap_createmailbox
* imap_delete
* imap_deletemailbox
* imap_expunge
* imap_fetchbody
* imap_fetchstructure
* imap_header
* imap_rfc822_parse_headers
* imap_headers
* imap_listmailbox
* imap_getmailboxes
* imap_listsubscribed
* imap_getsubscribed
* imap_mail_copy
* imap_mail_move
* imap_num_msg
* imap_num_recent
* imap_open
* imap_ping
* imap_renamemailbox
* imap_reopen
* imap_subscribe
* imap_undelete
* imap_unsubscribe
* imap_qprint
* imap_8bit
* imap_binary
* imap_scanmailbox
* imap_mailboxmsginfo
* imap_rfc822_write_address
* imap_rfc822_parse_adrlist
* imap_setflag_full
* imap_clearflag_full
* imap_sort
* imap_fetchheader
* imap_uid
* imap_msgno
* imap_search
* imap_last_error
* imap_errors
* imap_alerts
* imap_status
* imap_utf7_decode
* imap_utf7_encode
* imap_utf8
* imap_fetch_overview
* imap_mime_header_decode
* imap_mail_compose
* imap_mail
Manual: imap_delete
View the source code for this pageSearch the site



Previous page
 imap_createmailbox
 Updated
Sat, 12 Aug 2000
imap_deletemailbox 
Next page


imap_delete

(PHP3 , PHP4 )

imap_delete --  Mark a messge for deletion from current mailbox

Description

int imap_delete (int imap_stream, int msg_number [, int flags])

Returns true.

imap_delete() function marks message pointed by msg_number for deletion. The optional flags parameter only has a single option, FT_UID, which tells the function to treat the msg_number argument as a UID. Messages marked for deletion will stay in the mailbox until either imap_expunge() is called or imap_close() is called with the optional parameter CL_EXPUNGE.

Example 1. Imap_delete() Beispiel


$mbox = imap_open ("{your.imap.host}INBOX", "username", "password")
    || die ("can't connect: " . imap_last_error());

$check = imap_mailboxmsginfo ($mbox);
print "Messages before delete: " . $check->Nmsgs . "<br>\n" ;
imap_delete ($mbox, 1);
$check = imap_mailboxmsginfo ($mbox);
print "Messages after  delete: " . $check->Nmsgs . "<br>\n" ;
imap_expunge ($mbox);
$check = imap_mailboxmsginfo ($mbox);
print "Messages after expunge: " . $check->Nmsgs . "<br>\n" ;
imap_close ($mbox);
      


User Contributed Notes: imap_delete


sokolov@phix.de
06-Apr-2000 06:28
In PHP4 msg_number can be string with messages numbers (like a '1,2,6') and/or range of messages (like a '1:*')


vksgeneric@hotmail.com
17-Apr-2000 04:05
For all those people who ask "Why in the world can't I delete messages from POP3 boxes" - you need to expunge right after you delete. This flag is not persistent when dealing with POP3 boxes (compared to IMAP); thus if you had to reconnect to the POP3 server after you deleted something, but haven't expunged it yet, you loose it. In short, call expunge or explicitly close the box after you are done with marking messages for deletion.


hartmut@six.de
28-Jul-2000 06:55
this function was broken in 3.0.15,
this was fixed in 3.0.16


if you have to stay with 3.0.15
add a dummy ',0' as third parameter



 About Notes


Previous page
 imap_createmailbox
 Updated
Sat, 12 Aug 2000
imap_deletemailbox 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.