- ANSI C
- PERL
- PHP
- » Variable handling
- » Miscellaneous
- » POSIX
- » Date/Time
- » Math
- » menu_code_phpcode_strings
- » PCRE
- » Arrays
- » Classes
- » Program execution
- » Directories
- » Filesystem
- » GD
- » Network
- » menu_code_phpcode_sockte
- » SVN
- » IMAP
- » LDAP
- » MySQL
- » MySQLi
- » PgSQL
- » SQLite
- » SQLite3
- » pdo
- » MsSQL
- » Oracle
- » Informix
- » DB2
- » Firebird
- » Frontbase
- JavaScript
CONTENT
- CHANGES
Szukaj
#top IMAP¶
- IMAP
- IMAP Functions
- imap_8bit
- imap_alerts
- imap_append
- imap_base64
- imap_binary
- imap_body
- imap_bodystruct
- imap_check
- imap_clearflag_full
- imap_close
- imap_create
- imap_createmailbox
- imap_delete
- imap_deletemailbox
- imap_errors
- imap_expunge
- imap_fetch_overview
- imap_fetchbody
- imap_fetchheader
- imap_fetchmime
- imap_fetchstructure
- imap_fetchtext
- imap_gc
- imap_get_quota
- imap_get_quotaroot
- imap_getacl
- imap_getmailboxes
- imap_getsubscribed
- imap_header
- imap_headerinfo
- imap_headers
- imap_last_error
- imap_list
- imap_listmailbox
- imap_listscan
- imap_listsubscribed
- imap_lsub
- imap_mail_compose
- imap_mail_copy
- imap_mail_move
- imap_mail
- imap_mailboxmsginfo
- imap_mime_header_decode
- imap_msgno
- imap_num_msg
- imap_num_recent
- imap_open
- imap_ping
- imap_qprint
- imap_rename
- imap_renamemailbox
- imap_reopen
- imap_rfc822_parse_adrlist
- imap_rfc822_parse_headers
- imap_rfc822_write_address
- imap_savebody
- imap_scan
- imap_scanmailbox
- imap_search
- imap_set_quota
- imap_setacl
- imap_setflag_full
- imap_sort
- imap_status
- imap_subscribe
- imap_thread
- imap_timeout
- imap_uid
- imap_undelete
- imap_unsubscribe
- imap_utf7_decode
- imap_utf7_encode
- imap_utf8
code / php / imap
#top IMAP Functions¶
#top imap_8bit¶
Documentacja online: php.net
imap_8bit() - Convert an 8bit string to a quoted-printable stringDeklaracja funkcji
imap_8bit() jest następująca:string imap_8bit ( string $string )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_8bit.php:SELECT ALL
<?php
$textcont="ala ĄĆĘŁŃÓŚŹŻ ma ąćęłńóśźż kota";
$textquot=quoted_printable_encode($textcont);
$textimap=imap_8bit($textcont);
echo("textcont=|$textcont|\n");
echo("textquot=|$textquot|\n");
echo("textimap=|$textimap|\n");
?>
Sposób wywołania:
php -f imap_8bit.php
Rezultat wywołania:
textcont=|ala ĄĆĘŁŃÓŚŹŻ ma ąćęłńóśźż kota| textquot=|ala=20=C4=84=C4=86=C4=98=C5=81=C5=83=C3=93=C5=9A=C5=B9=C5=BB=20ma=20=C4=85=C4=87=C4=99=C5=82=C5=84=C3=B3=C5=9B=C5=BA=C5=BC=20kota| textimap=|ala =C4=84=C4=86=C4=98=C5=81=C5=83=C3=93=C5=9A=C5=B9=C5=BB ma =C4=85=C4=87= =C4=99=C5=82=C5=84=C3=B3=C5=9B=C5=BA=C5=BC kota|
#top imap_alerts¶
Documentacja online: php.net
imap_alerts() - Returns all IMAP alert messages that have occurredDeklaracja funkcji
imap_alerts() jest następująca:array imap_alerts ( void )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_alerts.php:SELECT ALL
Sposób wywołania:
php -f imap_alerts.php
Rezultat wywołania:
#top imap_append¶
Documentacja online: php.net
imap_append() - Append a string message to a specified mailboxDeklaracja funkcji
imap_append() jest następująca:bool imap_append ( resource $imap_stream , string $mailbox , string $message [, string $options = NULL [, string $internal_date = NULL ]] )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_append.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$date=strftime("%a, %d %b %Y %H:%M:%S +0200 (CEST)");
$emlsdata="Date: $date\nFrom: user@cen05kde.xen.wbcd.pl\nTo: sp@cen05.xen.wbcd.pl\nSubject: PHP imap_append test\n\nPHP imap_append test\nPHP imap_append test\nPHP imap_append test\n";
$result=imap_append($imap,$mbroot.$mbname,$emlsdata);
var_dump($result);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_append.php
Rezultat wywołania:
resource(1) of type (imap) bool(true) bool(true)
W przypadku gdy rezultat wywołania funkcji
imap_append() będzie analogicznie jak powyżej bool(true) w skrzynce (tak jak jest to zdefiniowane w powyższym) INBOX pojawi się wiadomość.#top imap_base64¶
Documentacja online: php.net
imap_base64() - Decode BASE64 encoded textDeklaracja funkcji
imap_base64() jest następująca:string imap_base64 ( string $text )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_base64.php:SELECT ALL
<?php
$base64cont=base64_encode("Ala ma kota");
$base64text=base64_decode($base64cont);
$base64imap=imap_base64($base64cont);
echo("base64cont=|$base64cont|\n");
echo("base64text=|$base64text|\n");
echo("base64imap=|$base64imap|\n");
?>
Sposób wywołania:
php -f imap_base64.php
Rezultat wywołania:
base64cont=|QWxhIG1hIGtvdGE=| base64text=|Ala ma kota| base64imap=|Ala ma kota|
Powyższy przykład pokazuje, że działanie funkcji
imap_base64() jest identyczne do działania funkcji base64_decode(), jednakże imap_base64() wymaga modułu imap.#top imap_binary¶
Documentacja online: php.net
imap_binary() - Convert an 8bit string to a base64 stringDeklaracja funkcji
imap_binary() jest następująca:string imap_binary ( string $string )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_binary1.php:SELECT ALL
<?php
$basestring="Ala ma kota";
$base64text=base64_encode($basestring);
$base64imap=imap_binary($basestring);
echo("base64text=|$base64text|\n");
echo("base64imap=|$base64imap|\n");
?>
Sposób wywołania:
php -f imap_binary1.php
Rezultat wywołania:
base64text=|QWxhIG1hIGtvdGE=| base64imap=|QWxhIG1hIGtvdGE= |
Powyższy przykład pokazuje, że działanie funkcji
imap_binary() jest analogiczne do działania funkcji base64_encode(), jednakże imap_binary() wymaga modułu imap oraz jak widać powyżej zakodowany ciąg zakończony jest nową linią.Zawartość pliku
imap_binary2.php:SELECT ALL
<?php
$basestring="Ala ma kota";
$base64text=base64_encode($basestring);
$base64imap=imap_binary($basestring);
$base64imap=rtrim($base64imap);
echo("base64text=|$base64text|\n");
echo("base64imap=|$base64imap|\n");
?>
Sposób wywołania:
php -f imap_binary2.php
Rezultat wywołania:
base64text=|QWxhIG1hIGtvdGE=| base64imap=|QWxhIG1hIGtvdGE=|
Powyższy przykład pokazuje, że działanie funkcji
imap_binary() w połączeniu z funkcją rtrim() jest identyczne do działania funkcji base64_encode(), jednakże imap_binary() wymaga modułu imap oraz jak widać powyżej zakodowany ciąg zakończony jest nową linią.#top imap_body¶
Documentacja online: php.net
imap_body() - Read the message bodyDeklaracja funkcji
imap_body() jest następująca:string imap_body ( resource $imap_stream , int $msg_number [, int $options = 0 ] )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_body1.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$body=imap_body($imap,1);
echo("body=|$body|\n");
imap_close($imap);
?>
Sposób wywołania:
php -f imap_body1.php
Rezultat wywołania:
resource(1) of type (imap) body=| mail_compose(): content: text/plain mail_compose(): content: text/plain mail_compose(): content: text/plain |
Zawartość pliku
imap_body2.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$body=imap_body($imap,2);
echo("body=|$body|\n");
imap_close($imap);
?>
Sposób wywołania:
php -f imap_body2.php
Rezultat wywołania:
resource(1) of type (imap) body=| <html> <head> </head> <body> mail_compose(): content: text/html
---==--===--==---
mail_compose(): content: text/html
---==--===--==---
mail_compose(): content: text/html
</body> </html> |
Zawartość pliku
imap_body3.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$body=imap_body($imap,3);
echo("body=|$body|\n");
imap_close($imap);
?>
Sposób wywołania:
php -f imap_body3.php
Rezultat wywołania:
resource(1) of type (imap) body=|This is a multi-part message in MIME format. --1bed933535c861b04bacef4084896d05 Content-Type: text/plain; charset=utf-8 mail_compose(): content: text/plain mail_compose(): content: text/plain mail_compose(): content: text/plain --1bed933535c861b04bacef4084896d05 Content-Type: text/html; charset=utf-8 <html> <head> </head> <body> mail_compose(): content: text/html
---==--===--==---
mail_compose(): content: text/html
---==--===--==---
mail_compose(): content: text/html
</body> </html> --1bed933535c861b04bacef4084896d05-- |
#top imap_bodystruct¶
Documentacja online: php.net
imap_bodystruct() - Read the structure of a specified body section of a specific messageDeklaracja funkcji
imap_bodystruct() jest następująca:object imap_bodystruct ( resource $imap_stream , int $msg_number , string $section )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_bodystruct1.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$body=imap_fetchstructure($imap,1);
$body=get_object_vars($body);
foreach ($body["parameters"] as $kk1=>$vv1) {
if (is_object($body["parameters"][$kk1])) $body["parameters"][$kk1]=get_object_vars($body["parameters"][$kk1]);
}
print_r($body);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_bodystruct1.php
Rezultat wywołania:
resource(1) of type (imap)
Array
(
[type] => 0
[encoding] => 0
[ifsubtype] => 1
[subtype] => PLAIN
[ifdescription] => 0
[ifid] => 0
[lines] => 4
[bytes] => 113
[ifdisposition] => 0
[ifdparameters] => 0
[ifparameters] => 1
[parameters] => Array
(
[0] => Array
(
[attribute] => charset
[value] => utf-8
)
)
)
Zawartość pliku
imap_bodystruct2.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$body=imap_fetchstructure($imap,2);
$body=get_object_vars($body);
foreach ($body["parameters"] as $kk1=>$vv1) {
if (is_object($body["parameters"][$kk1])) $body["parameters"][$kk1]=get_object_vars($body["parameters"][$kk1]);
}
print_r($body);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_bodystruct2.php
Rezultat wywołania:
resource(1) of type (imap)
Array
(
[type] => 0
[encoding] => 0
[ifsubtype] => 1
[subtype] => HTML
[ifdescription] => 0
[ifid] => 0
[lines] => 13
[bytes] => 231
[ifdisposition] => 0
[ifdparameters] => 0
[ifparameters] => 1
[parameters] => Array
(
[0] => Array
(
[attribute] => charset
[value] => utf-8
)
)
)
Zawartość pliku
imap_bodystruct3.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$body=imap_fetchstructure($imap,3);
$body=get_object_vars($body);
foreach ($body["parameters"] as $kk1=>$vv1) {
if (is_object($body["parameters"][$kk1])) $body["parameters"][$kk1]=get_object_vars($body["parameters"][$kk1]);
}
print_r($body);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_bodystruct3.php
Rezultat wywołania:
resource(1) of type (imap)
Array
(
[type] => 1
[encoding] => 0
[ifsubtype] => 1
[subtype] => ALTERNATIVE
[ifdescription] => 0
[ifid] => 0
[ifdisposition] => 0
[ifdparameters] => 0
[ifparameters] => 1
[parameters] => Array
(
[0] => Array
(
[attribute] => boundary
[value] => 1bed933535c861b04bacef4084896d05
)
)
[parts] => Array
(
[0] => stdClass Object
(
[type] => 0
[encoding] => 0
[ifsubtype] => 1
[subtype] => PLAIN
[ifdescription] => 0
[ifid] => 0
[lines] => 4
[bytes] => 113
[ifdisposition] => 0
[ifdparameters] => 0
[ifparameters] => 1
[parameters] => Array
(
[0] => stdClass Object
(
[attribute] => charset
[value] => utf-8
)
)
)
[1] => stdClass Object
(
[type] => 0
[encoding] => 0
[ifsubtype] => 1
[subtype] => HTML
[ifdescription] => 0
[ifid] => 0
[lines] => 12
[bytes] => 229
[ifdisposition] => 0
[ifdparameters] => 0
[ifparameters] => 1
[parameters] => Array
(
[0] => stdClass Object
(
[attribute] => charset
[value] => utf-8
)
)
)
)
)
#top imap_check¶
Documentacja online: php.net
imap_check() - Check current mailboxDeklaracja funkcji
imap_check() jest następująca:object imap_check ( resource $imap_stream )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_check.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$IMAPINFO=imap_check($imap);
$IMAPINFO=get_object_vars($IMAPINFO);
print_r($IMAPINFO);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_check.php
Rezultat wywołania:
resource(1) of type (imap)
Array
(
[Date] => Tue, 3 Sep 2013 20:49:10 +0200 (CEST)
[Driver] => imap
[Mailbox] => {cen05.xen.wbcd.pl:143/imap/tls/novalidate-cert/user="sp"}INBOX
[Nmsgs] => 14
[Recent] => 0
)
#top imap_clearflag_full¶
Documentacja online: php.net
imap_clearflag_full() - Clears flags on messagesDeklaracja funkcji
imap_clearflag_full() jest następująca:bool imap_clearflag_full ( resource $imap_stream , string $sequence , string $flag [, int $options = 0 ] )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_clearflag_full1.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$imapoverview=imap_fetch_overview($imap,"1:1",0);
foreach ($imapoverview as $key=>$val) {
$imapoverview[$key]=get_object_vars($imapoverview[$key]);
}
print_r($imapoverview);
$result=imap_clearflag_full($imap,"1:1", "\\Seen");
var_dump($result);
$imapoverview=imap_fetch_overview($imap,"1:1",0);
foreach ($imapoverview as $key=>$val) {
$imapoverview[$key]=get_object_vars($imapoverview[$key]);
}
print_r($imapoverview);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_clearflag_full1.php
Rezultat wywołania:
resource(1) of type (imap)
Array
(
[0] => Array
(
[subject] => mail_compose test +TEXT -HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[size] => 347
[uid] => 6524
[msgno] => 1
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
)
bool(true)
Array
(
[0] => Array
(
[subject] => mail_compose test +TEXT -HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[size] => 347
[uid] => 6524
[msgno] => 1
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 0
[draft] => 0
)
)
Zawartość pliku
imap_clearflag_full2.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$imapoverview=imap_fetch_overview($imap,"1:1",0);
foreach ($imapoverview as $key=>$val) {
$imapoverview[$key]=get_object_vars($imapoverview[$key]);
}
print_r($imapoverview);
$result=imap_clearflag_full($imap,"1:1", "\\Seen \\Answered \\Flagged \\Deleted \\Draft");
var_dump($result);
$imapoverview=imap_fetch_overview($imap,"1:1",0);
foreach ($imapoverview as $key=>$val) {
$imapoverview[$key]=get_object_vars($imapoverview[$key]);
}
print_r($imapoverview);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_clearflag_full2.php
Rezultat wywołania:
resource(1) of type (imap)
Array
(
[0] => Array
(
[subject] => mail_compose test +TEXT -HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[size] => 347
[uid] => 6524
[msgno] => 1
[recent] => 0
[flagged] => 1
[answered] => 1
[deleted] => 1
[seen] => 1
[draft] => 1
)
)
bool(true)
Array
(
[0] => Array
(
[subject] => mail_compose test +TEXT -HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[size] => 347
[uid] => 6524
[msgno] => 1
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 0
[draft] => 0
)
)
#top imap_close¶
Documentacja online: php.net
imap_close() - Close an IMAP streamDeklaracja funkcji
imap_close() jest następująca:bool imap_close ( resource $imap_stream [, int $flag = 0 ] )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_close.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$result=imap_close($imap);
var_dump($result);
?>
Sposób wywołania:
php -f imap_close.php
Rezultat wywołania:
resource(1) of type (imap) bool(true)
#top imap_create¶
Documentacja online: php.net
imap_create() - Alias of imap_createmailbox#top imap_createmailbox¶
Documentacja online: php.net
imap_createmailbox() - Create a new mailboxDeklaracja funkcji
imap_createmailbox() jest następująca:bool imap_createmailbox ( resource $imap_stream , string $mailbox )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_createmailbox.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$result=imap_createmailbox($imap,$mbroot."temp");
var_dump($result);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_createmailbox.php
Rezultat wywołania:
resource(1) of type (imap) bool(true)
#top imap_delete¶
Documentacja online: php.net
imap_delete() - Mark a message for deletion from current mailboxDeklaracja funkcji
imap_delete() jest następująca:bool imap_delete ( resource $imap_stream , int $msg_number [, int $options = 0 ] )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_delete.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$imapoverview=imap_fetch_overview($imap,"1:1",0);
foreach ($imapoverview as $key=>$val) {
$imapoverview[$key]=get_object_vars($imapoverview[$key]);
}
print_r($imapoverview);
$result=imap_delete($imap,1);
var_dump($result);
$imapoverview=imap_fetch_overview($imap,"1:1",0);
foreach ($imapoverview as $key=>$val) {
$imapoverview[$key]=get_object_vars($imapoverview[$key]);
}
print_r($imapoverview);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_delete.php
Rezultat wywołania:
resource(1) of type (imap)
Array
(
[0] => Array
(
[subject] => mail_compose test +TEXT -HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[size] => 347
[uid] => 6524
[msgno] => 1
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
)
bool(true)
Array
(
[0] => Array
(
[subject] => mail_compose test +TEXT -HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[size] => 347
[uid] => 6524
[msgno] => 1
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 1
[seen] => 1
[draft] => 0
)
)
Jak widać na powyższym przykładzie wywołanie funkcji
imap_delete() nie powoduje skasowania wiadomości, tylko oznaczenie jej flagą skasowana, dzięki temu tak skasowana wiadomość jest w dalszym ciągu do odzyskania do czasu wywołania funkcji imap_expunge() na bieżącej skrzynce w której wiadomość została skasowana. Aby odzyskać tak skasowaną wiadomość można również wywołać przeciwną funkcję imap_undelete().#top imap_deletemailbox¶
Documentacja online: php.net
imap_deletemailbox() - Delete a mailboxDeklaracja funkcji
imap_deletemailbox() jest następująca:bool imap_deletemailbox ( resource $imap_stream , string $mailbox )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_deletemailbox.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$result=imap_deletemailbox($imap,$mbroot."test");
var_dump($result);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_deletemailbox.php
Rezultat wywołania:
resource(1) of type (imap) bool(true)
#top imap_errors¶
Documentacja online: php.net
imap_errors() - Returns all of the IMAP errors that have occuredDeklaracja funkcji
imap_errors() jest następująca:array imap_errors ( void )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_errors.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$result=imap_deletemailbox($imap,$mbroot."test");
var_dump($result);
print_r(imap_errors());
imap_close($imap);
?>
Sposób wywołania:
php -f imap_errors.php
Rezultat wywołania:
resource(1) of type (imap)
bool(false)
Array
(
[0] => [NONEXISTENT] Mailbox doesn't exist: test
)
#top imap_expunge¶
Documentacja online: php.net
imap_expunge() - Delete all messages marked for deletionDeklaracja funkcji
imap_expunge() jest następująca:bool imap_expunge ( resource $imap_stream )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_expunge.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$result=imap_expunge($imap);
var_dump($result);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_expunge.php
Rezultat wywołania:
resource(1) of type (imap) bool(true)
#top imap_fetch_overview¶
Documentacja online: php.net
imap_fetch_overview() - Read an overview of the information in the headers of the given messageDeklaracja funkcji
imap_fetch_overview() jest następująca:array imap_fetch_overview ( resource $imap_stream , string $sequence [, int $options = 0 ] )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_fetch_overview.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$msgsnum=imap_num_msg($imap);
$imapoverview=imap_fetch_overview($imap,"1:$msgsnum",0);
foreach ($imapoverview as $key=>$val) {
$imapoverview[$key]=get_object_vars($imapoverview[$key]);
}
print_r($imapoverview);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_fetch_overview.php
Rezultat wywołania:
resource(1) of type (imap)
Array
(
[0] => Array
(
[subject] => mail_compose test +TEXT -HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[size] => 347
[uid] => 6524
[msgno] => 1
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[1] => Array
(
[subject] => mail_compose test -TEXT +HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:05 +0200
[message_id] => <20130707211605.1bc09f88404f473f@myphp.xnd.pl>
[size] => 464
[uid] => 6525
[msgno] => 2
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[2] => Array
(
[subject] => mail_compose test +TEXT +HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:05 +0200
[message_id] => <20130707211605.ae91d5398253309e@myphp.xnd.pl>
[size] => 881
[uid] => 6526
[msgno] => 3
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[3] => Array
(
[subject] => mail_compose test +TEXT -HTML +ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:06 +0200
[message_id] => <20130707211606.e9b496d1bf047c2b@myphp.xnd.pl>
[size] => 18271
[uid] => 6527
[msgno] => 4
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[4] => Array
(
[subject] => mail_compose test -TEXT +HTML +ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:07 +0200
[message_id] => <20130707211607.77876347dacf1064@myphp.xnd.pl>
[size] => 18386
[uid] => 6528
[msgno] => 5
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[5] => Array
(
[subject] => mail_compose test +TEXT +HTML +ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:08 +0200
[message_id] => <20130707211608.8f1129a87e90584e@myphp.xnd.pl>
[size] => 18698
[uid] => 6529
[msgno] => 6
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[6] => Array
(
[subject] => mail_compose test +TEXT +HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:09 +0200
[message_id] => <20130707211609.1bdcc1077fe94101@myphp.xnd.pl>
[size] => 113168
[uid] => 6530
[msgno] => 7
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[7] => Array
(
[subject] => mail_compose test +TEXT +HTML +ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:10 +0200
[message_id] => <20130707211610.b2812b03f93a7686@myphp.xnd.pl>
[size] => 130983
[uid] => 6531
[msgno] => 8
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[8] => Array
(
[subject] => [Fwd: Cron <root@x-cen05> run-parts /etc/cron.daily]
[from] => sp <sp@cen05.xen.wbcd.pl>
[to] => sp <sp@wb.muszelka.pw.edu.pl>
[date] => Thu, 22 Sep 2011 11:25:02 +0200
[message_id] => <4E7AFEEE.3090003@cen05.xen.wbcd.pl>
[size] => 918
[uid] => 6532
[msgno] => 9
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[9] => Array
(
[subject] => [Fwd: Cron <root@x-cen05> run-parts /etc/cron.daily]
[from] => sp <sp@cen05.xen.wbcd.pl>
[to] => sp <sp@wb.muszelka.pw.edu.pl>
[date] => Thu, 22 Sep 2011 11:25:53 +0200
[message_id] => <4E7AFF21.4070407@cen05.xen.wbcd.pl>
[size] => 918
[uid] => 6533
[msgno] => 10
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[10] => Array
(
[subject] => Fwd: test - Redmine ASF
[from] => sp <sp@cen05.xen.wbcd.pl>
[to] => sp <sp@cen06-1.cen05.xen.wbcd.pl>
[date] => Sun, 03 Jun 2012 09:14:55 +0200
[message_id] => <4FCB0EEF.9020304@cen05.xen.wbcd.pl>
[size] => 1039
[uid] => 6534
[msgno] => 11
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[11] => Array
(
[subject] => Undelivered Mail Returned to Sender
[from] => Mail Delivery System <MAILER-DAEMON@cen06x64.xen.wbcd.pl>
[to] => root@cen06x64.xen.wbcd.pl
[date] => Thu, 8 Aug 2013 20:20:54 +0200 (CEST)
[message_id] => <20130808182054.372A347D01@cen06x64.xen.wbcd.pl>
[size] => 2735
[uid] => 6535
[msgno] => 12
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[12] => Array
(
[subject] => test
[from] => sp@xnd
[to] => sp@cen05
[date] => Fri, 16 Aug 2013 17:43:21 +0200 (CEST)
[message_id] => <20130816154321.CB6A7B21A5@cen05.xen.wbcd.pl>
[size] => 487
[uid] => 6536
[msgno] => 13
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[13] => Array
(
[subject] => PHP imap_append test
[from] => user@cen05.xen.wbcd.pl
[to] => sp@cen05.xen.wbcd.pl
[date] => Mon, 02 Sep 2013 07:56:47 +0200 (CEST)
[size] => 201
[uid] => 6539
[msgno] => 14
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
)
#top imap_fetchbody¶
Documentacja online: php.net
imap_fetchbody() - Fetch a particular section of the body of the messageDeklaracja funkcji
imap_fetchbody() jest następująca:string imap_fetchbody ( resource $imap_stream , int $msg_number , string $section [, int $options = 0 ] )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_fetchbody1.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$head=imap_fetchbody($imap,1,"0");
echo("head=|$head|\n");
$body1=imap_fetchbody($imap,1,"1");
echo("body1=|$body1|\n");
$body2=imap_fetchbody($imap,1,"2");
echo("body2=|$body2|\n");
imap_close($imap);
?>
Sposób wywołania:
php -f imap_fetchbody1.php
Rezultat wywołania:
resource(1) of type (imap) head=|From: joe@example.com To: foo@example.com Subject: mail_compose test +TEXT -HTML -ATTACH Date: Sun, 7 Jul 2013 21:16:04 +0200 Message-Id: <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl> Content-Type: text/plain; charset=utf-8 | body1=| mail_compose(): content: text/plain mail_compose(): content: text/plain mail_compose(): content: text/plain | body2=||
Zawartość pliku
imap_fetchbody2.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$head=imap_fetchbody($imap,2,"0");
echo("head=|$head|\n");
$body1=imap_fetchbody($imap,2,"1");
echo("body1=|$body1|\n");
$body2=imap_fetchbody($imap,2,"2");
echo("body2=|$body2|\n");
imap_close($imap);
?>
Sposób wywołania:
php -f imap_fetchbody2.php
Rezultat wywołania:
resource(1) of type (imap) head=|From: joe@example.com To: foo@example.com Subject: mail_compose test -TEXT +HTML -ATTACH Date: Sun, 7 Jul 2013 21:16:05 +0200 Message-Id: <20130707211605.1bc09f88404f473f@myphp.xnd.pl> Content-Type: text/html; charset=utf-8 | body1=| <html> <head> </head> <body> mail_compose(): content: text/html
---==--===--==---
mail_compose(): content: text/html
---==--===--==---
mail_compose(): content: text/html
</body> </html> | body2=||
Zawartość pliku
imap_fetchbody3.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$head=imap_fetchbody($imap,3,"0");
echo("head=|$head|\n");
$body1=imap_fetchbody($imap,3,"1");
echo("body1=|$body1|\n");
$body2=imap_fetchbody($imap,3,"2");
echo("body2=|$body2|\n");
imap_close($imap);
?>
Sposób wywołania:
php -f imap_fetchbody3.php
Rezultat wywołania:
resource(1) of type (imap) head=|From: joe@example.com To: foo@example.com Subject: mail_compose test +TEXT +HTML -ATTACH Date: Sun, 7 Jul 2013 21:16:05 +0200 Message-Id: <20130707211605.ae91d5398253309e@myphp.xnd.pl> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="1bed933535c861b04bacef4084896d05" | body1=| mail_compose(): content: text/plain mail_compose(): content: text/plain mail_compose(): content: text/plain | body2=| <html> <head> </head> <body> mail_compose(): content: text/html
---==--===--==---
mail_compose(): content: text/html
---==--===--==---
mail_compose(): content: text/html
</body> </html> |
#top imap_fetchheader¶
Documentacja online: php.net
imap_fetchheader() - Returns header for a messageDeklaracja funkcji
imap_fetchheader() jest następująca:string imap_fetchheader ( resource $imap_stream , int $msg_number [, int $options = 0 ] )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_fetchheader1.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$head=imap_fetchheader($imap,1);
echo("head=|$head|\n");
imap_close($imap);
?>
Sposób wywołania:
php -f imap_fetchheader1.php
Rezultat wywołania:
resource(1) of type (imap) head=|From: joe@example.com To: foo@example.com Subject: mail_compose test +TEXT -HTML -ATTACH Date: Sun, 7 Jul 2013 21:16:04 +0200 Message-Id: <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl> Content-Type: text/plain; charset=utf-8 |
Zawartość pliku
imap_fetchheader2.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$head=imap_fetchheader($imap,1);
echo("head=|$head|\n");
imap_close($imap);
?>
Sposób wywołania:
php -f imap_fetchheader2.php
Rezultat wywołania:
resource(1) of type (imap) head=|From: joe@example.com To: foo@example.com Subject: mail_compose test -TEXT +HTML -ATTACH Date: Sun, 7 Jul 2013 21:16:05 +0200 Message-Id: <20130707211605.1bc09f88404f473f@myphp.xnd.pl> Content-Type: text/html; charset=utf-8 |
Zawartość pliku
imap_fetchheader3.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$head=imap_fetchheader($imap,1);
echo("head=|$head|\n");
imap_close($imap);
?>
Sposób wywołania:
php -f imap_fetchheader3.php
Rezultat wywołania:
resource(1) of type (imap) head=|From: joe@example.com To: foo@example.com Subject: mail_compose test +TEXT +HTML -ATTACH Date: Sun, 7 Jul 2013 21:16:05 +0200 Message-Id: <20130707211605.ae91d5398253309e@myphp.xnd.pl> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="1bed933535c861b04bacef4084896d05" |
#top imap_fetchmime¶
Documentacja online: php.net
imap_fetchmime() - Fetch MIME headers for a particular section of the messageDeklaracja funkcji
imap_fetchmime() jest następująca:string imap_fetchmime ( resource $imap_stream , int $msg_number , string $section [, int $options = 0 ] )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_fetchmime.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$mime=imap_fetchmime($imap,1,"1");
echo("mime=|$mime|\n");
imap_close($imap);
?>
Sposób wywołania:
php -f imap_fetchmime.php
Rezultat wywołania:
resource(4) of type (imap) PHP Fatal error: Call to undefined function imap_fetchmime() in /home/user/tmp/imap_fetchmime.php on line 9 Fatal error: Call to undefined function imap_fetchmime() in /home/user/tmp/imap_fetchmime.php on line 9
#top imap_fetchstructure¶
Documentacja online: php.net
imap_fetchstructure() - Read the structure of a particular messageDeklaracja funkcji
imap_fetchstructure() jest następująca:object imap_fetchstructure ( resource $imap_stream , int $msg_number [, int $options = 0 ] )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_fetchstructure1.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$MESSAGE=imap_fetchstructure($imap,1);
$MESSAGE=get_object_vars($MESSAGE);
print_r($MESSAGE);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_fetchstructure1.php
Rezultat wywołania:
resource(1) of type (imap)
Array
(
[type] => 0
[encoding] => 0
[ifsubtype] => 1
[subtype] => PLAIN
[ifdescription] => 0
[ifid] => 0
[lines] => 4
[bytes] => 113
[ifdisposition] => 0
[ifdparameters] => 0
[ifparameters] => 1
[parameters] => Array
(
[0] => stdClass Object
(
[attribute] => charset
[value] => utf-8
)
)
)
Zawartość pliku
imap_fetchstructure2.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$MESSAGE=imap_fetchstructure($imap,1);
$MESSAGE=get_object_vars($MESSAGE);
print_r($MESSAGE);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_fetchstructure2.php
Rezultat wywołania:
resource(1) of type (imap)
Array
(
[type] => 0
[encoding] => 0
[ifsubtype] => 1
[subtype] => HTML
[ifdescription] => 0
[ifid] => 0
[lines] => 13
[bytes] => 231
[ifdisposition] => 0
[ifdparameters] => 0
[ifparameters] => 1
[parameters] => Array
(
[0] => stdClass Object
(
[attribute] => charset
[value] => utf-8
)
)
)
Zawartość pliku
imap_fetchstructure3.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$MESSAGE=imap_fetchstructure($imap,1);
$MESSAGE=get_object_vars($MESSAGE);
print_r($MESSAGE);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_fetchstructure3.php
Rezultat wywołania:
resource(1) of type (imap)
Array
(
[type] => 1
[encoding] => 0
[ifsubtype] => 1
[subtype] => ALTERNATIVE
[ifdescription] => 0
[ifid] => 0
[ifdisposition] => 0
[ifdparameters] => 0
[ifparameters] => 1
[parameters] => Array
(
[0] => stdClass Object
(
[attribute] => boundary
[value] => 1bed933535c861b04bacef4084896d05
)
)
[parts] => Array
(
[0] => stdClass Object
(
[type] => 0
[encoding] => 0
[ifsubtype] => 1
[subtype] => PLAIN
[ifdescription] => 0
[ifid] => 0
[lines] => 4
[bytes] => 113
[ifdisposition] => 0
[ifdparameters] => 0
[ifparameters] => 1
[parameters] => Array
(
[0] => stdClass Object
(
[attribute] => charset
[value] => utf-8
)
)
)
[1] => stdClass Object
(
[type] => 0
[encoding] => 0
[ifsubtype] => 1
[subtype] => HTML
[ifdescription] => 0
[ifid] => 0
[lines] => 12
[bytes] => 229
[ifdisposition] => 0
[ifdparameters] => 0
[ifparameters] => 1
[parameters] => Array
(
[0] => stdClass Object
(
[attribute] => charset
[value] => utf-8
)
)
)
)
)
#top imap_fetchtext¶
Documentacja online: php.net
imap_fetchtext() - Alias of imap_body#top imap_gc¶
Documentacja online: php.net
imap_gc() - Clears IMAP cacheDeklaracja funkcji
imap_gc() jest następująca:bool imap_gc ( resource $imap_stream , int $caches )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_gc.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$result=imap_gc($imap, 10);
var_dump($result);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_gc.php
Rezultat wywołania:
resource(1) of type (imap) PHP Fatal error: Call to undefined function imap_gc() in /home/user/tmp/imap_gc.php on line 9 Fatal error: Call to undefined function imap_gc() in /home/user/tmp/imap_gc.php on line 9
#top imap_get_quota¶
Documentacja online: php.net
imap_get_quota() - Retrieve the quota level settings, and usage statics per mailboxDeklaracja funkcji
imap_get_quota() jest następująca:array imap_get_quota ( resource $imap_stream , string $quota_root )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_get_quota.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$result=imap_get_quota($imap, $mbroot.$mbname);
var_dump($result);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_get_quota.php
Rezultat wywołania:
resource(1) of type (imap) PHP Warning: imap_get_quota(): c-client imap_getquota failed in /home/user/tmp/imap_get_quota.php on line 9 Warning: imap_get_quota(): c-client imap_getquota failed in /home/user/tmp/imap_get_quota.php on line 9 bool(false) PHP Notice: Unknown: Quota not available on this IMAP server (errflg=2) in Unknown on line 0 Notice: Unknown: Quota not available on this IMAP server (errflg=2) in Unknown on line 0
#top imap_get_quotaroot¶
Documentacja online: php.net
imap_get_quotaroot() - Retrieve the quota settings per userDeklaracja funkcji
imap_get_quotaroot() jest następująca:array imap_get_quotaroot ( resource $imap_stream , string $quota_root )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_get_quotaroot.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$result=imap_get_quotaroot($imap, $mbroot.$mbname);
var_dump($result);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_get_quotaroot.php
Rezultat wywołania:
resource(1) of type (imap) PHP Warning: imap_get_quotaroot(): c-client imap_getquotaroot failed in /home/user/tmp/imap_get_quotaroot.php on line 9 Warning: imap_get_quotaroot(): c-client imap_getquotaroot failed in /home/user/tmp/imap_get_quotaroot.php on line 9 bool(false) PHP Notice: Unknown: Quota not available on this IMAP server (errflg=2) in Unknown on line 0 Notice: Unknown: Quota not available on this IMAP server (errflg=2) in Unknown on line 0
#top imap_getacl¶
Documentacja online: php.net
imap_getacl() - Gets the ACL for a given mailboxDeklaracja funkcji
imap_getacl() jest następująca:array imap_getacl ( resource $imap_stream , string $mailbox )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_getacl.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$result=imap_getacl($imap, $mbroot.$mbname);
var_dump($result);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_getacl.php
Rezultat wywołania:
resource(1) of type (imap) PHP Warning: c-client imap_getacl failed in /home/user/tmp/imap_getacl.php on line 9 Warning: c-client imap_getacl failed in /home/user/tmp/imap_getacl.php on line 9 bool(false) PHP Notice: Unknown: ACL not available on this IMAP server (errflg=2) in Unknown on line 0 Notice: Unknown: ACL not available on this IMAP server (errflg=2) in Unknown on line 0
#top imap_getmailboxes¶
Documentacja online: php.net
imap_getmailboxes() - Read the list of mailboxes, returning detailed information on each oneDeklaracja funkcji
imap_getmailboxes() jest następująca:array imap_getmailboxes ( resource $imap_stream , string $ref , string $pattern )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_getmailboxes.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$MBLIST=imap_getmailboxes($imap,$mbroot,"*");
print_r($MBLIST);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_getmailboxes.php
Rezultat wywołania:
resource(1) of type (imap)
Array
(
[0] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch
[attributes] => 32
[delimiter] => .
)
[1] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.obsd1-fw0
[attributes] => 64
[delimiter] => .
)
[2] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.cen06-2
[attributes] => 64
[delimiter] => .
)
[3] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.deb6vz
[attributes] => 64
[delimiter] => .
)
[4] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.cen05kde
[attributes] => 64
[delimiter] => .
)
[5] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.chiliproject
[attributes] => 64
[delimiter] => .
)
[6] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.redmold
[attributes] => 64
[delimiter] => .
)
[7] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.cen05
[attributes] => 64
[delimiter] => .
)
[8] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.cen06kde
[attributes] => 64
[delimiter] => .
)
[9] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.free2
[attributes] => 64
[delimiter] => .
)
[10] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.cen06-1
[attributes] => 64
[delimiter] => .
)
[11] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.redmine
[attributes] => 64
[delimiter] => .
)
[12] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.obsd2-fw1
[attributes] => 64
[delimiter] => .
)
[13] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.free1
[attributes] => 64
[delimiter] => .
)
[14] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.cen05x64
[attributes] => 64
[delimiter] => .
)
[15] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.cen06x64
[attributes] => 64
[delimiter] => .
)
[16] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}loghosts-cen05-all
[attributes] => 64
[delimiter] => .
)
[17] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}REDMINEMBOX
[attributes] => 32
[delimiter] => .
)
[18] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}REDMINEMBOX.SMTP
[attributes] => 64
[delimiter] => .
)
[19] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}REDMINEMBOX.IMAP
[attributes] => 32
[delimiter] => .
)
[20] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}REDMINEMBOX.IMAP.serwis
[attributes] => 64
[delimiter] => .
)
[21] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}REDMINEMBOX.redmine-todo
[attributes] => 64
[delimiter] => .
)
[22] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}REDMINEMBOX.redmine-done
[attributes] => 64
[delimiter] => .
)
[23] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}sunbird
[attributes] => 64
[delimiter] => .
)
[24] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}Templates
[attributes] => 64
[delimiter] => .
)
[25] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}svnwatchers
[attributes] => 64
[delimiter] => .
)
[26] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}Sent
[attributes] => 64
[delimiter] => .
)
[27] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}pflogsum-cen05
[attributes] => 64
[delimiter] => .
)
[28] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}SPAM
[attributes] => 64
[delimiter] => .
)
[29] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}Drafts
[attributes] => 64
[delimiter] => .
)
[30] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}emails
[attributes] => 64
[delimiter] => .
)
[31] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}Trash
[attributes] => 64
[delimiter] => .
)
[32] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}nagios3
[attributes] => 64
[delimiter] => .
)
[33] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}INBOX
[attributes] => 64
[delimiter] => .
)
)
#top imap_getsubscribed¶
Documentacja online: php.net
imap_getsubscribed() - List all the subscribed mailboxesDeklaracja funkcji
imap_getsubscribed() jest następująca:array imap_getsubscribed ( resource $imap_stream , string $ref , string $pattern )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_getsubscribed.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$MBLIST=imap_getsubscribed($imap,$mbroot,"*");
print_r($MBLIST);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_getsubscribed.php
Rezultat wywołania:
resource(1) of type (imap)
Array
(
[0] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}Drafts
[attributes] => 0
[delimiter] => .
)
[1] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}INBOX
[attributes] => 0
[delimiter] => .
)
[2] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}Sent
[attributes] => 0
[delimiter] => .
)
[3] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}Templates
[attributes] => 0
[delimiter] => .
)
[4] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}Trash
[attributes] => 0
[delimiter] => .
)
[5] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}SPAM
[attributes] => 0
[delimiter] => .
)
[6] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}nagios3
[attributes] => 0
[delimiter] => .
)
[7] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}REDMINEMBOX
[attributes] => 0
[delimiter] => .
)
[8] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}REDMINEMBOX.IMAP
[attributes] => 0
[delimiter] => .
)
[9] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}REDMINEMBOX.IMAP.serwis
[attributes] => 0
[delimiter] => .
)
[10] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}REDMINEMBOX.SMTP
[attributes] => 0
[delimiter] => .
)
[11] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}REDMINEMBOX.redmine-done
[attributes] => 0
[delimiter] => .
)
[12] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}REDMINEMBOX.redmine-todo
[attributes] => 0
[delimiter] => .
)
[13] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch
[attributes] => 0
[delimiter] => .
)
[14] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.cen05
[attributes] => 0
[delimiter] => .
)
[15] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.cen05kde
[attributes] => 0
[delimiter] => .
)
[16] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.cen05x64
[attributes] => 0
[delimiter] => .
)
[17] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.cen06-1
[attributes] => 0
[delimiter] => .
)
[18] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.cen06-2
[attributes] => 0
[delimiter] => .
)
[19] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.cen06kde
[attributes] => 0
[delimiter] => .
)
[20] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.cen06x64
[attributes] => 0
[delimiter] => .
)
[21] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.chiliproject
[attributes] => 0
[delimiter] => .
)
[22] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.deb6vz
[attributes] => 0
[delimiter] => .
)
[23] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.free1
[attributes] => 0
[delimiter] => .
)
[24] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.free2
[attributes] => 0
[delimiter] => .
)
[25] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.obsd1-fw0
[attributes] => 0
[delimiter] => .
)
[26] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.obsd2-fw1
[attributes] => 0
[delimiter] => .
)
[27] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.redmine
[attributes] => 0
[delimiter] => .
)
[28] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.redmold
[attributes] => 0
[delimiter] => .
)
[29] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}loghosts-cen05-all
[attributes] => 0
[delimiter] => .
)
[30] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}pflogsum-cen05
[attributes] => 0
[delimiter] => .
)
[31] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}svnwatchers
[attributes] => 0
[delimiter] => .
)
[32] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}sunbird
[attributes] => 0
[delimiter] => .
)
[33] => stdClass Object
(
[name] => {cen05.xen.wbcd.pl/tls/novalidate-cert}emails
[attributes] => 0
[delimiter] => .
)
)
#top imap_header¶
Documentacja online: php.net
imap_header() - Alias of imap_headerinfo#top imap_headerinfo¶
Documentacja online: php.net
imap_headerinfo() - Read the header of the messageDeklaracja funkcji
imap_headerinfo() jest następująca:object imap_headerinfo ( resource $imap_stream , int $msg_number [, int $fromlength = 0 [, int $subjectlength = 0 [, string $defaulthost = NULL ]]] )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_headerinfo1.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$HEAD=imap_headerinfo($imap,1);
$HEAD=get_object_vars($HEAD);
print_r($HEAD);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_headerinfo1.php
Rezultat wywołania:
resource(1) of type (imap)
Array
(
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[Date] => Sun, 7 Jul 2013 21:16:04 +0200
[subject] => mail_compose test +TEXT -HTML -ATTACH
[Subject] => mail_compose test +TEXT -HTML -ATTACH
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[toaddress] => foo@example.com
[to] => Array
(
[0] => stdClass Object
(
[mailbox] => foo
[host] => example.com
)
)
[fromaddress] => joe@example.com
[from] => Array
(
[0] => stdClass Object
(
[mailbox] => joe
[host] => example.com
)
)
[reply_toaddress] => joe@example.com
[reply_to] => Array
(
[0] => stdClass Object
(
[mailbox] => joe
[host] => example.com
)
)
[senderaddress] => joe@example.com
[sender] => Array
(
[0] => stdClass Object
(
[mailbox] => joe
[host] => example.com
)
)
[Recent] =>
[Unseen] =>
[Flagged] =>
[Answered] =>
[Deleted] =>
[Draft] =>
[Msgno] => 1
[MailDate] => 7-Jul-2013 21:16:03 +0200
[Size] => 347
[udate] => 1373224563
)
Zawartość pliku
imap_headerinfo2.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$HEAD=imap_headerinfo($imap,2);
$HEAD=get_object_vars($HEAD);
print_r($HEAD);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_headerinfo2.php
Rezultat wywołania:
resource(1) of type (imap)
Array
(
[date] => Sun, 7 Jul 2013 21:16:05 +0200
[Date] => Sun, 7 Jul 2013 21:16:05 +0200
[subject] => mail_compose test -TEXT +HTML -ATTACH
[Subject] => mail_compose test -TEXT +HTML -ATTACH
[message_id] => <20130707211605.1bc09f88404f473f@myphp.xnd.pl>
[toaddress] => foo@example.com
[to] => Array
(
[0] => stdClass Object
(
[mailbox] => foo
[host] => example.com
)
)
[fromaddress] => joe@example.com
[from] => Array
(
[0] => stdClass Object
(
[mailbox] => joe
[host] => example.com
)
)
[reply_toaddress] => joe@example.com
[reply_to] => Array
(
[0] => stdClass Object
(
[mailbox] => joe
[host] => example.com
)
)
[senderaddress] => joe@example.com
[sender] => Array
(
[0] => stdClass Object
(
[mailbox] => joe
[host] => example.com
)
)
[Recent] =>
[Unseen] =>
[Flagged] =>
[Answered] =>
[Deleted] =>
[Draft] =>
[Msgno] => 2
[MailDate] => 7-Jul-2013 21:16:04 +0200
[Size] => 464
[udate] => 1373224564
)
Zawartość pliku
imap_headerinfo3.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$HEAD=imap_headerinfo($imap,3);
$HEAD=get_object_vars($HEAD);
print_r($HEAD);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_headerinfo3.php
Rezultat wywołania:
resource(1) of type (imap)
Array
(
[date] => Sun, 7 Jul 2013 21:16:05 +0200
[Date] => Sun, 7 Jul 2013 21:16:05 +0200
[subject] => mail_compose test +TEXT +HTML -ATTACH
[Subject] => mail_compose test +TEXT +HTML -ATTACH
[message_id] => <20130707211605.ae91d5398253309e@myphp.xnd.pl>
[toaddress] => foo@example.com
[to] => Array
(
[0] => stdClass Object
(
[mailbox] => foo
[host] => example.com
)
)
[fromaddress] => joe@example.com
[from] => Array
(
[0] => stdClass Object
(
[mailbox] => joe
[host] => example.com
)
)
[reply_toaddress] => joe@example.com
[reply_to] => Array
(
[0] => stdClass Object
(
[mailbox] => joe
[host] => example.com
)
)
[senderaddress] => joe@example.com
[sender] => Array
(
[0] => stdClass Object
(
[mailbox] => joe
[host] => example.com
)
)
[Recent] =>
[Unseen] =>
[Flagged] =>
[Answered] =>
[Deleted] =>
[Draft] =>
[Msgno] => 3
[MailDate] => 7-Jul-2013 21:16:05 +0200
[Size] => 881
[udate] => 1373224565
)
#top imap_headers¶
Documentacja online: php.net
imap_headers() - Returns headers for all messages in a mailboxDeklaracja funkcji
imap_headers() jest następująca:array imap_headers ( resource $imap_stream )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_headers.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$HEAD=imap_headers($imap);
print_r($HEAD);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_headers.php
Rezultat wywołania:
resource(1) of type (imap)
Array
(
[0] => 1) 7-Jul-2013 joe@example.com mail_compose test +TEXT - (347 chars)
[1] => 2) 7-Jul-2013 joe@example.com mail_compose test -TEXT + (464 chars)
[2] => 3) 7-Jul-2013 joe@example.com mail_compose test +TEXT + (881 chars)
[3] => 4) 7-Jul-2013 joe@example.com mail_compose test +TEXT - (18271 chars)
[4] => 5) 7-Jul-2013 joe@example.com mail_compose test -TEXT + (18386 chars)
[5] => 6) 7-Jul-2013 joe@example.com mail_compose test +TEXT + (18698 chars)
[6] => 7) 7-Jul-2013 joe@example.com mail_compose test +TEXT + (113168 chars)
[7] => 8) 7-Jul-2013 joe@example.com mail_compose test +TEXT + (130983 chars)
[8] => 9)22-Sep-2011 sp [Fwd: Cron <root@x-cen05> (918 chars)
[9] => 10)22-Sep-2011 sp [Fwd: Cron <root@x-cen05> (918 chars)
[10] => 11) 3-Jun-2012 sp Fwd: test - Redmine ASF (1039 chars)
[11] => 12) 8-Aug-2013 Mail Delivery System Undelivered Mail Returned (2735 chars)
[12] => 13)16-Aug-2013 sp@xnd {NonJunk} test (487 chars)
[13] => 14) 2-Sep-2013 user@cen05.xen.wbss. {NonJunk} PHP imap_append test (201 chars)
)
#top imap_last_error¶
Documentacja online: php.net
imap_last_error() - Gets the last IMAP error that occurred during this page requestDeklaracja funkcji
imap_last_error() jest następująca:string imap_last_error ( void )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_last_error1.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$result=imap_deletemailbox($imap,$mbroot."test");
var_dump($result);
echo("imap_last_error()=".imap_last_error()."\n");
print_r(imap_errors());
imap_close($imap);
?>
Sposób wywołania:
php -f imap_last_error1.php
Rezultat wywołania:
resource(1) of type (imap)
bool(false)
imap_last_error()=[NONEXISTENT] Mailbox doesn't exist: test
Array
(
[0] => [NONEXISTENT] Mailbox doesn't exist: test
)
Zawartość pliku
imap_last_error2.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$result=imap_deletemailbox($imap,$mbroot."test");
var_dump($result);
print_r(imap_errors());
echo("imap_last_error()=".imap_last_error()."\n");
imap_close($imap);
?>
Sposób wywołania:
php -f imap_last_error2.php
Rezultat wywołania:
resource(1) of type (imap)
bool(false)
Array
(
[0] => [NONEXISTENT] Mailbox doesn't exist: test
)
imap_last_error()=
Jak widać w powyższym przykładzie
imap_last_error() zwraca ostatni błąd związany z operacją na strumieniu imap, jednakże właściwe umiejscowienie wywołania funkcji imap_last_error() (odczytanie informacji o błędzie) ma znaczenie.#top imap_list¶
Documentacja online: php.net
imap_list() - Read the list of mailboxesDeklaracja funkcji
imap_list() jest następująca:array imap_list ( resource $imap_stream , string $ref , string $pattern )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_list.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$MBLIST=imap_list($imap,$mbroot,"*");
print_r($MBLIST);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_list.php
Rezultat wywołania:
resource(1) of type (imap)
Array
(
[0] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch
[1] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.obsd1-fw0
[2] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.cen06-2
[3] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.deb6vz
[4] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.cen05kde
[5] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.chiliproject
[6] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.redmold
[7] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.cen05
[8] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.cen06kde
[9] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.free2
[10] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.cen06-1
[11] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.redmine
[12] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.obsd2-fw1
[13] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.free1
[14] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.cen05x64
[15] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.cen06x64
[16] => {cen05.xen.wbcd.pl/tls/novalidate-cert}loghosts-cen05-all
[17] => {cen05.xen.wbcd.pl/tls/novalidate-cert}REDMINEMBOX
[18] => {cen05.xen.wbcd.pl/tls/novalidate-cert}REDMINEMBOX.SMTP
[19] => {cen05.xen.wbcd.pl/tls/novalidate-cert}REDMINEMBOX.IMAP
[20] => {cen05.xen.wbcd.pl/tls/novalidate-cert}REDMINEMBOX.IMAP.serwis
[21] => {cen05.xen.wbcd.pl/tls/novalidate-cert}REDMINEMBOX.redmine-todo
[22] => {cen05.xen.wbcd.pl/tls/novalidate-cert}REDMINEMBOX.redmine-done
[23] => {cen05.xen.wbcd.pl/tls/novalidate-cert}sunbird
[24] => {cen05.xen.wbcd.pl/tls/novalidate-cert}Templates
[25] => {cen05.xen.wbcd.pl/tls/novalidate-cert}svnwatchers
[26] => {cen05.xen.wbcd.pl/tls/novalidate-cert}Sent
[27] => {cen05.xen.wbcd.pl/tls/novalidate-cert}pflogsum-cen05
[28] => {cen05.xen.wbcd.pl/tls/novalidate-cert}SPAM
[29] => {cen05.xen.wbcd.pl/tls/novalidate-cert}Drafts
[30] => {cen05.xen.wbcd.pl/tls/novalidate-cert}emails
[31] => {cen05.xen.wbcd.pl/tls/novalidate-cert}Trash
[32] => {cen05.xen.wbcd.pl/tls/novalidate-cert}nagios3
[33] => {cen05.xen.wbcd.pl/tls/novalidate-cert}INBOX
)
#top imap_listmailbox¶
Documentacja online: php.net
imap_listmailbox() - Alias of imap_list#top imap_listscan¶
Documentacja online: php.net
imap_listscan() - Returns the list of mailboxes that matches the given textDeklaracja funkcji
imap_listscan() jest następująca:array imap_listscan ( resource $imap_stream , string $ref , string $pattern , string $content )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_listscan.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$MBLIST=imap_listscan($imap,$mbroot,"*","text");
print_r($MBLIST);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_listscan.php
Rezultat wywołania:
resource(1) of type (imap) PHP Fatal error: Call to undefined function imap_listscan() in /home/user/tmp/imap_listscan.php on line 9 Fatal error: Call to undefined function imap_listscan() in /home/user/tmp/imap_listscan.php on line 9
#top imap_listsubscribed¶
Documentacja online: php.net
imap_listsubscribed() - Alias of imap_lsub#top imap_lsub¶
Documentacja online: php.net
imap_lsub() - List all the subscribed mailboxesDeklaracja funkcji
imap_lsub() jest następująca:array imap_lsub ( resource $imap_stream , string $ref , string $pattern )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_lsub.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$MBLIST=imap_lsub($imap,$mbroot,"*");
print_r($MBLIST);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_lsub.php
Rezultat wywołania:
resource(1) of type (imap)
Array
(
[0] => {cen05.xen.wbcd.pl/tls/novalidate-cert}Drafts
[1] => {cen05.xen.wbcd.pl/tls/novalidate-cert}INBOX
[2] => {cen05.xen.wbcd.pl/tls/novalidate-cert}Sent
[3] => {cen05.xen.wbcd.pl/tls/novalidate-cert}Templates
[4] => {cen05.xen.wbcd.pl/tls/novalidate-cert}Trash
[5] => {cen05.xen.wbcd.pl/tls/novalidate-cert}SPAM
[6] => {cen05.xen.wbcd.pl/tls/novalidate-cert}nagios3
[7] => {cen05.xen.wbcd.pl/tls/novalidate-cert}REDMINEMBOX
[8] => {cen05.xen.wbcd.pl/tls/novalidate-cert}REDMINEMBOX.IMAP
[9] => {cen05.xen.wbcd.pl/tls/novalidate-cert}REDMINEMBOX.IMAP.serwis
[10] => {cen05.xen.wbcd.pl/tls/novalidate-cert}REDMINEMBOX.SMTP
[11] => {cen05.xen.wbcd.pl/tls/novalidate-cert}REDMINEMBOX.redmine-done
[12] => {cen05.xen.wbcd.pl/tls/novalidate-cert}REDMINEMBOX.redmine-todo
[13] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch
[14] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.cen05
[15] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.cen05kde
[16] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.cen05x64
[17] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.cen06-1
[18] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.cen06-2
[19] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.cen06kde
[20] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.cen06x64
[21] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.chiliproject
[22] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.deb6vz
[23] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.free1
[24] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.free2
[25] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.obsd1-fw0
[26] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.obsd2-fw1
[27] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.redmine
[28] => {cen05.xen.wbcd.pl/tls/novalidate-cert}logwatch.redmold
[29] => {cen05.xen.wbcd.pl/tls/novalidate-cert}loghosts-cen05-all
[30] => {cen05.xen.wbcd.pl/tls/novalidate-cert}pflogsum-cen05
[31] => {cen05.xen.wbcd.pl/tls/novalidate-cert}svnwatchers
[32] => {cen05.xen.wbcd.pl/tls/novalidate-cert}sunbird
[33] => {cen05.xen.wbcd.pl/tls/novalidate-cert}emails
)
#top imap_mail_compose¶
Documentacja online: php.net
imap_mail_compose() - Create a MIME message based on given envelope and body sectionsDeklaracja funkcji
imap_mail_compose() jest następująca:string imap_mail_compose ( array $envelope , array $body )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_mail_compose.php:SELECT ALL
<?php $envelope["from"]= "joe@example.com"; $envelope["to"] = "foo@example.com"; $envelope["cc"] = "bar@example.com"; $part1["type"] = TYPEMULTIPART; $part1["subtype"] = "mixed"; $filename = "/tmp/imap.c.gz"; $contents = "Content of filename $filename\nContent of filename $filename\nContent of filename $filename\n"; $part2["type"] = TYPEAPPLICATION; $part2["encoding"] = ENCBINARY; $part2["subtype"] = "octet-stream"; $part2["description"] = basename($filename); $part2["contents.data"] = $contents; $part3["type"] = TYPETEXT; $part3["subtype"] = "plain"; $part3["description"] = "description3"; $part3["contents.data"] = "contents.data3\n\n\n\t"; $body[1] = $part1; $body[2] = $part2; $body[3] = $part3; echo nl2br(imap_mail_compose($envelope, $body)); ?>
Sposób wywołania:
php -f imap_mail_compose.php
Rezultat wywołania:
From: joe@example.com To: foo@example.com cc: bar@example.com MIME-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY="656128-477622200-1378243861=:6879" --656128-477622200-1378243861=:6879 Content-Type: APPLICATION/octet-stream Content-Transfer-Encoding: BASE64 Content-Description: imap.c.gz Q29udGVudCBvZiBmaWxlbmFtZSAvdG1wL2ltYXAuYy5negpDb250ZW50IG9m IGZpbGVuYW1lIC90bXAvaW1hcC5jLmd6CkNvbnRlbnQgb2YgZmlsZW5hbWUg L3RtcC9pbWFwLmMuZ3oK --656128-477622200-1378243861=:6879 Content-Type: TEXT/plain; CHARSET=US-ASCII Content-Description: description3 contents.data3 --656128-477622200-1378243861=:6879--
#top imap_mail_copy¶
Documentacja online: php.net
imap_mail_copy() - Copy specified messages to a mailboxDeklaracja funkcji
imap_mail_copy() jest następująca:bool imap_mail_copy ( resource $imap_stream , string $msglist , string $mailbox [, int $options = 0 ] )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_mail_copy1.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$imapoverview=imap_fetch_overview($imap,"1:1",0);
foreach ($imapoverview as $key=>$val) {
$imapoverview[$key]=get_object_vars($imapoverview[$key]);
}
print_r($imapoverview);
$result=imap_mail_copy($imap, "1", "Trash", CP_MOVE);
var_dump($result);
$imapoverview=imap_fetch_overview($imap,"1:1",0);
foreach ($imapoverview as $key=>$val) {
$imapoverview[$key]=get_object_vars($imapoverview[$key]);
}
print_r($imapoverview);
$result=imap_reopen($imap,$mbroot."Trash");
var_dump($result);
$imapoverview=imap_fetch_overview($imap,"1:1",0);
foreach ($imapoverview as $key=>$val) {
$imapoverview[$key]=get_object_vars($imapoverview[$key]);
}
print_r($imapoverview);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_mail_copy1.php
Rezultat wywołania:
resource(1) of type (imap)
Array
(
[0] => Array
(
[subject] => mail_compose test +TEXT -HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[size] => 347
[uid] => 6524
[msgno] => 1
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
)
bool(true)
Array
(
[0] => Array
(
[subject] => mail_compose test +TEXT -HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[size] => 347
[uid] => 6524
[msgno] => 1
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 1
[seen] => 1
[draft] => 0
)
)
bool(true)
Array
(
[0] => Array
(
[subject] => mail_compose test +TEXT -HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[size] => 347
[uid] => 10898
[msgno] => 1
[recent] => 1
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
)
Zawartość pliku
imap_mail_copy2.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$imapoverview=imap_fetch_overview($imap,"1:1",0);
foreach ($imapoverview as $key=>$val) {
$imapoverview[$key]=get_object_vars($imapoverview[$key]);
}
print_r($imapoverview);
$result=imap_mail_copy($imap, "1", "Trash");
var_dump($result);
$result=imap_delete($imap,1);
var_dump($result);
$imapoverview=imap_fetch_overview($imap,"1:1",0);
foreach ($imapoverview as $key=>$val) {
$imapoverview[$key]=get_object_vars($imapoverview[$key]);
}
print_r($imapoverview);
$result=imap_reopen($imap,$mbroot."Trash");
var_dump($result);
$imapoverview=imap_fetch_overview($imap,"1:1",0);
foreach ($imapoverview as $key=>$val) {
$imapoverview[$key]=get_object_vars($imapoverview[$key]);
}
print_r($imapoverview);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_mail_copy2.php
Rezultat wywołania:
resource(1) of type (imap)
Array
(
[0] => Array
(
[subject] => mail_compose test +TEXT -HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[size] => 347
[uid] => 6524
[msgno] => 1
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
)
bool(true)
bool(true)
Array
(
[0] => Array
(
[subject] => mail_compose test +TEXT -HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[size] => 347
[uid] => 6524
[msgno] => 1
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 1
[seen] => 1
[draft] => 0
)
)
bool(true)
Array
(
[0] => Array
(
[subject] => mail_compose test +TEXT -HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[size] => 347
[uid] => 10899
[msgno] => 1
[recent] => 1
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
)
Powyższe przykłady pokazują w jaki sposób większość klientów poczty przenosi wiadomości. W pierwszej kolejności wiadomość jest kopiowana do folderu docelowego, następnie przenoszona (kopiowana) wiadomość oznaczana jest jako skasowana w folderze źródłowym. Do czasu wywołania komendy porządkowania folderu wiadomość w dalszym ciągu znajduje się w skrzynce źródłowej i jest możliwe jej odzyskanie.
#top imap_mail_move¶
Documentacja online: php.net
imap_mail_move() - Move specified messages to a mailboxDeklaracja funkcji
imap_mail_move() jest następująca:bool imap_mail_move ( resource $imap_stream , string $msglist , string $mailbox [, int $options = 0 ] )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_mail_move.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$imapoverview=imap_fetch_overview($imap,"1:1",0);
foreach ($imapoverview as $key=>$val) {
$imapoverview[$key]=get_object_vars($imapoverview[$key]);
}
print_r($imapoverview);
$result=imap_mail_move($imap, "1", "Trash");
var_dump($result);
$imapoverview=imap_fetch_overview($imap,"1:1",0);
foreach ($imapoverview as $key=>$val) {
$imapoverview[$key]=get_object_vars($imapoverview[$key]);
}
print_r($imapoverview);
$result=imap_reopen($imap,$mbroot."Trash");
var_dump($result);
$imapoverview=imap_fetch_overview($imap,"1:1",0);
foreach ($imapoverview as $key=>$val) {
$imapoverview[$key]=get_object_vars($imapoverview[$key]);
}
print_r($imapoverview);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_mail_move.php
Rezultat wywołania:
resource(1) of type (imap)
Array
(
[0] => Array
(
[subject] => mail_compose test +TEXT -HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[size] => 347
[uid] => 6524
[msgno] => 1
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
)
bool(true)
Array
(
[0] => Array
(
[subject] => mail_compose test +TEXT -HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[size] => 347
[uid] => 6524
[msgno] => 1
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 1
[seen] => 1
[draft] => 0
)
)
bool(true)
Array
(
[0] => Array
(
[subject] => mail_compose test +TEXT -HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[size] => 347
[uid] => 10900
[msgno] => 1
[recent] => 1
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
)
#top imap_mail¶
Documentacja online: php.net
imap_mail() - Send an email messageDeklaracja funkcji
imap_mail() jest następująca:bool imap_mail ( string $to , string $subject , string $message [, string $additional_headers = NULL [, string $cc = NULL [, string $bcc = NULL [, string $rpath = NULL ]]]] )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_mail.php:SELECT ALL
<?php
$date=strftime("%a, %d %b %Y %H:%M:%S +0200 (CEST)");
$emlsdata="PHP imap_mail() test\nPHP imap_mail() test\nPHP imap_mail() test\n";
$result=imap_mail("sp@cen05.xen.wbcd.pl", "PHP imap_mail() test", $emlsdata, "Date: $date\nFrom: user@cen05kde.xen.wbcd.pl");
var_dump($result);
?>
Sposób wywołania:
php -f imap_mail.php
Rezultat wywołania:
bool(true)
#top imap_mailboxmsginfo¶
Documentacja online: php.net
imap_mailboxmsginfo() - Get information about the current mailboxDeklaracja funkcji
imap_mailboxmsginfo() jest następująca:object imap_mailboxmsginfo ( resource $imap_stream )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_mailboxmsginfo.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$MBINFO=imap_mailboxmsginfo($imap);
var_dump($MBINFO);
print_r($MBINFO);
$MBINFO=get_object_vars($MBINFO);
print_r($MBINFO);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_mailboxmsginfo.php
Rezultat wywołania:
resource(1) of type (imap)
object(stdClass)#1 (8) {
["Unread"]=>
int(0)
["Deleted"]=>
int(0)
["Nmsgs"]=>
int(15)
["Size"]=>
int(307843)
["Date"]=>
string(37) "Wed, 4 Sep 2013 22:03:39 +0200 (CEST)"
["Driver"]=>
string(4) "imap"
["Mailbox"]=>
string(63) "{cen05.xen.wbcd.pl:143/imap/tls/novalidate-cert/user="sp"}INBOX"
["Recent"]=>
int(0)
}
stdClass Object
(
[Unread] => 0
[Deleted] => 0
[Nmsgs] => 15
[Size] => 307843
[Date] => Wed, 4 Sep 2013 22:03:39 +0200 (CEST)
[Driver] => imap
[Mailbox] => {cen05.xen.wbcd.pl:143/imap/tls/novalidate-cert/user="sp"}INBOX
[Recent] => 0
)
Array
(
[Unread] => 0
[Deleted] => 0
[Nmsgs] => 15
[Size] => 307843
[Date] => Wed, 4 Sep 2013 22:03:39 +0200 (CEST)
[Driver] => imap
[Mailbox] => {cen05.xen.wbcd.pl:143/imap/tls/novalidate-cert/user="sp"}INBOX
[Recent] => 0
)
#top imap_mime_header_decode¶
Documentacja online: php.net
imap_mime_header_decode() - Decode MIME header elementsDeklaracja funkcji
imap_mime_header_decode() jest następująca:array imap_mime_header_decode ( string $text )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_mime_header_decode.php:SELECT ALL
<?php
$textcont="ala ĄĆĘŁŃÓŚŹŻ ma ąćęłńóśźż kota";
$textquot=quoted_printable_encode($textcont);
$textquot="=?UTF-8?Q?$textquot?=";
$TEXTIMAPMIME=imap_mime_header_decode($textquot);
echo("textcont=|$textcont|\n");
echo("textquot=|$textquot|\n");
var_dump($TEXTIMAPMIME);
print_r($TEXTIMAPMIME);
?>
Sposób wywołania:
php -f imap_mime_header_decode.php
Rezultat wywołania:
textcont=|ala ĄĆĘŁŃÓŚŹŻ ma ąćęłńóśźż kota|
textquot=|=?UTF-8?Q?ala=20=C4=84=C4=86=C4=98=C5=81=C5=83=C3=93=C5=9A=C5=B9=C5=BB=20ma=20=C4=85=C4=87=C4=99=C5=82=C5=84=C3=B3=C5=9B=C5=BA=C5=BC=20kota?=|
array(1) {
[0]=>
object(stdClass)#1 (2) {
["charset"]=>
string(5) "UTF-8"
["text"]=>
string(49) "ala ĄĆĘŁŃÓŚŹŻ ma ąćęłńóśźż kota"
}
}
Array
(
[0] => stdClass Object
(
[charset] => UTF-8
[text] => ala ĄĆĘŁŃÓŚŹŻ ma ąćęłńóśźż kota
)
)
#top imap_msgno¶
Documentacja online: php.net
imap_msgno() - Gets the message sequence number for the given UIDDeklaracja funkcji
imap_msgno() jest następująca:int imap_msgno ( resource $imap_stream , int $uid )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_msgno.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$uid1=6524;
$uid2=6525;
$uid3=6526;
$msgno1=imap_msgno($imap,$uid1);
$msgno2=imap_msgno($imap,$uid2);
$msgno3=imap_msgno($imap,$uid3);
echo("uid1=$uid1 msgno1=$msgno1\n");
echo("uid2=$uid2 msgno2=$msgno2\n");
echo("uid3=$uid3 msgno3=$msgno3\n");
imap_close($imap);
?>
Sposób wywołania:
php -f imap_msgno.php
Rezultat wywołania:
resource(1) of type (imap) uid1=6524 msgno1=1 uid2=6525 msgno2=2 uid3=6526 msgno3=3
#top imap_num_msg¶
Documentacja online: php.net
imap_num_msg() - Gets the number of messages in the current mailboxDeklaracja funkcji
imap_num_msg() jest następująca:int imap_num_msg ( resource $imap_stream )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_num_msg.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$msgs=imap_num_msg($imap);
var_dump($msgs);
echo("msgs=|$msgs|\n");
imap_close($imap);
?>
Sposób wywołania:
php -f imap_num_msg.php
Rezultat wywołania:
resource(1) of type (imap) int(15) msgs=|15|
#top imap_num_recent¶
Documentacja online: php.net
imap_num_recent() - Gets the number of recent messages in current mailboxDeklaracja funkcji
imap_num_recent() jest następująca:int imap_num_recent ( resource $imap_stream )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_num_recent.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$recent=imap_num_recent($imap);
var_dump($recent);
echo("recent=|$recent|\n");
imap_close($imap);
?>
Aby zrozumieć znaczenie wartości zwracanej przez funkcję
imap_num_recent() w pierwszej kolejności należy wysłać emaila na sprawdzaną skrzynkę (należy również upewnić się, że wysłana wiadomość nie zostanie przeniesiona do podfolderu w wyniku działania filtrów np: sieve na serwerze).Sposób wywołania:
php -f imap_num_recent.php
Rezultat wywołania:
resource(1) of type (imap) int(1) recent=|1|
Sposób ponownego wywołania (powtórne wywołanie):
php -f imap_num_recent.php
Rezultat wywołania:
resource(1) of type (imap) int(0) recent=|0|
Jak widać na powyższym przykładzie przy dwukrotnym wywołaniu funkcji
imap_num_recent() funkcja za pierwszym razem zwraca ilość "nowych" wiadomości, które pojawiły się na skrzynce od ostatniego czasu sprawdzania skrzynki.#top imap_open¶
Documentacja online: php.net
imap_open() - Open an IMAP stream to a mailboxDeklaracja funkcji
imap_open() jest następująca:resource imap_open ( string $mailbox , string $username , string $password [, int $options = NIL [, int $n_retries = 0 [, array $params = NULL ]]] )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_open.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$result=imap_close($imap);
var_dump($result);
?>
Sposób wywołania:
php -f imap_open.php
Rezultat wywołania:
resource(1) of type (imap) bool(true)
#top imap_ping¶
Documentacja online: php.net
imap_ping() - Check if the IMAP stream is still activeDeklaracja funkcji
imap_ping() jest następująca:bool imap_ping ( resource $imap_stream )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_ping.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$result=imap_ping($imap);
var_dump($result);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_ping.php
Rezultat wywołania:
resource(1) of type (imap) bool(true)
#top imap_qprint¶
Documentacja online: php.net
imap_qprint() - Convert a quoted-printable string to an 8 bit stringDeklaracja funkcji
imap_qprint() jest następująca:string imap_qprint ( string $string )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_qprint.php:SELECT ALL
<?php
$textcont="ala ĄĆĘŁŃÓŚŹŻ ma ąćęłńóśźż kota";
$textquot=quoted_printable_encode($textcont);
$textqprt=imap_qprint($textquot);
echo("textcont=|$textcont|\n");
echo("textquot=|$textquot|\n");
echo("textqprt=|$textqprt|\n");
?>
Sposób wywołania:
php -f imap_qprint.php
Rezultat wywołania:
textcont=|ala ĄĆĘŁŃÓŚŹŻ ma ąćęłńóśźż kota| textquot=|ala=20=C4=84=C4=86=C4=98=C5=81=C5=83=C3=93=C5=9A=C5=B9=C5=BB=20ma=20=C4=85=C4=87=C4=99=C5=82=C5=84=C3=B3=C5=9B=C5=BA=C5=BC=20kota| textqprt=|ala ĄĆĘŁŃÓŚŹŻ ma ąćęłńóśźż kota|
#top imap_rename¶
Documentacja online: php.net
imap_rename() - Alias of imap_renamemailbox#top imap_renamemailbox¶
Documentacja online: php.net
imap_renamemailbox() - Rename an old mailbox to new mailboxDeklaracja funkcji
imap_renamemailbox() jest następująca:bool imap_renamemailbox ( resource $imap_stream , string $old_mbox , string $new_mbox )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_renamemailbox.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$result=imap_renamemailbox($imap,$mbroot."temp",$mbroot."test");
var_dump($result);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_renamemailbox.php
Rezultat wywołania:
resource(1) of type (imap) bool(true)
#top imap_reopen¶
Documentacja online: php.net
imap_reopen() - Reopen IMAP stream to new mailboxDeklaracja funkcji
imap_reopen() jest następująca:bool imap_reopen ( resource $imap_stream , string $mailbox [, int $options = 0 [, int $n_retries = 0 ]] )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_reopen.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$result=imap_reopen($imap,$mbroot."Trash");
var_dump($result);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_reopen.php
Rezultat wywołania:
resource(1) of type (imap) bool(true)
#top imap_rfc822_parse_adrlist¶
Documentacja online: php.net
imap_rfc822_parse_adrlist() - Parses an address stringDeklaracja funkcji
imap_rfc822_parse_adrlist() jest następująca:array imap_rfc822_parse_adrlist ( string $address , string $default_host )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_rfc822_parse_adrlist.php:SELECT ALL
<?php
$addrtext="Joe Doe <doe@example.com>, postmaster@example.com, root";
$ADDRARRAY=imap_rfc822_parse_adrlist($addrtext, "example.com");
foreach ($ADDRARRAY as $key=>$val) {
if (is_object($ADDRARRAY[$key])) $ADDRARRAY[$key]=get_object_vars($ADDRARRAY[$key]);
}
echo("addrtext=|$addrtext|\n");
print_r($ADDRARRAY);
?>
Sposób wywołania:
php -f imap_rfc822_parse_adrlist.php
Rezultat wywołania:
addrtext=|Joe Doe <doe@example.com>, postmaster@example.com, root|
Array
(
[0] => Array
(
[mailbox] => doe
[host] => example.com
[personal] => Joe Doe
)
[1] => Array
(
[mailbox] => postmaster
[host] => example.com
)
[2] => Array
(
[mailbox] => root
[host] => example.com
)
)
#top imap_rfc822_parse_headers¶
Documentacja online: php.net
imap_rfc822_parse_headers() - Parse mail headers from a stringDeklaracja funkcji
imap_rfc822_parse_headers() jest następująca:object imap_rfc822_parse_headers ( string $headers [, string $defaulthost = "UNKNOWN" ] )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_rfc822_parse_headers.php:SELECT ALL
<?php
$date=strftime("%a, %d %b %Y %H:%M:%S +0200 (CEST)");
$headtext="Date: $date\nFrom: user at example dot org <user@example.org>\nTo: Joe Doe <doe@example.com>, postmaster@example.com, root\nSubject: PHP imap_append test\n";
$HEADARRAY=imap_rfc822_parse_headers($headtext, "example.com");
$HEADARRAY=get_object_vars($HEADARRAY);
foreach ($HEADARRAY as $key=>$val) {
if (is_object($HEADARRAY[$key])) $HEADARRAY[$key]=get_object_vars($HEADARRAY[$key]);
}
echo("headtext=|$headtext|\n");
print_r($HEADARRAY);
?>
Sposób wywołania:
php -f imap_rfc822_parse_headers.php
Rezultat wywołania:
headtext=|Date: Wed, 04 Sep 2013 23:08:05 +0200 (CEST)
From: user at example dot org <user@example.org>
To: Joe Doe <doe@example.com>, postmaster@example.com, root
Subject: PHP imap_append test
|
Array
(
[date] => Wed, 04 Sep 2013 23:08:05 +0200 (CEST)
[Date] => Wed, 04 Sep 2013 23:08:05 +0200 (CEST)
[subject] => PHP imap_append test
[Subject] => PHP imap_append test
[toaddress] => Joe Doe <doe@example.com>, postmaster@example.com, root@example.com
[to] => Array
(
[0] => stdClass Object
(
[personal] => Joe Doe
[mailbox] => doe
[host] => example.com
)
[1] => stdClass Object
(
[mailbox] => postmaster
[host] => example.com
)
[2] => stdClass Object
(
[mailbox] => root
[host] => example.com
)
)
[fromaddress] => user at example dot org <user@example.org>
[from] => Array
(
[0] => stdClass Object
(
[personal] => user at example dot org
[mailbox] => user
[host] => example.org
)
)
[reply_toaddress] => user at example dot org <user@example.org>
[reply_to] => Array
(
[0] => stdClass Object
(
[personal] => user at example dot org
[mailbox] => user
[host] => example.org
)
)
[senderaddress] => user at example dot org <user@example.org>
[sender] => Array
(
[0] => stdClass Object
(
[personal] => user at example dot org
[mailbox] => user
[host] => example.org
)
)
)
#top imap_rfc822_write_address¶
Documentacja online: php.net
imap_rfc822_write_address() - Returns a properly formatted email address given the mailbox, host, and personal infoDeklaracja funkcji
imap_rfc822_write_address() jest następująca:string imap_rfc822_write_address ( string $mailbox , string $host , string $personal )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_rfc822_write_address.php:SELECT ALL
<?php
$addrrfc822=imap_rfc822_write_address("username", "example.com", "Hartmut Holzgraefe");
echo("addrrfc822=|$addrrfc822|\n");
?>
Sposób wywołania:
php -f imap_rfc822_write_address.php
Rezultat wywołania:
addrrfc822=|Hartmut Holzgraefe <username@example.com>|
#top imap_savebody¶
Documentacja online: php.net
imap_savebody() - Save a specific body section to a fileDeklaracja funkcji
imap_savebody() jest następująca:bool imap_savebody ( resource $imap_stream , mixed $file , int $msg_number [, string $part_number = "" [, int $options = 0 ]] )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_savebody.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$emlsname="/home/user/tmp/emlscont.eml";
$result=imap_savebody($imap,$emlsname,1);
var_dump($result);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_savebody.php
Rezultat wywołania:
resource(1) of type (imap) bool(true)
W przypadku gdy rezultat wywołania funkcji
imap_savebody() będzie analogicznie jak powyżej bool(true) w pliku o podanej ścieżce /home/user/tmp/emlscont.eml zostanie zapisana wiadomość. Jest to prawdopodobnie jedyny sposób pobrania całej wiadomości wraz z nagłówkami w tzw. "trybie raw", bez żadnego dekodowania zawartości przez moduł IMAP.#top imap_scan¶
Documentacja online: php.net
imap_scan() - Alias of imap_listscan#top imap_scanmailbox¶
Documentacja online: php.net
imap_scanmailbox() - Alias of imap_listscan#top imap_search¶
Documentacja online: php.net
imap_search() - This function returns an array of messages matching the given search criteriaDeklaracja funkcji
imap_search() jest następująca:array imap_search ( resource $imap_stream , string $criteria [, int $options = SE_FREE [, string $charset = NIL ]] )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_search1.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$LIST=imap_search($imap, "ALL");
print_r($LIST);
$msglist=implode(",",$LIST);
$imapoverview=imap_fetch_overview($imap,$msglist,0);
foreach ($imapoverview as $key=>$val) {
$imapoverview[$key]=get_object_vars($imapoverview[$key]);
}
print_r($imapoverview);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_search1.php
Rezultat wywołania:
resource(1) of type (imap)
Array
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
[4] => 5
[5] => 6
[6] => 7
[7] => 8
[8] => 9
[9] => 10
[10] => 11
[11] => 12
[12] => 13
[13] => 14
[14] => 15
[15] => 16
)
Array
(
[0] => Array
(
[subject] => mail_compose test +TEXT -HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[size] => 347
[uid] => 6524
[msgno] => 1
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[1] => Array
(
[subject] => mail_compose test -TEXT +HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:05 +0200
[message_id] => <20130707211605.1bc09f88404f473f@myphp.xnd.pl>
[size] => 464
[uid] => 6525
[msgno] => 2
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[2] => Array
(
[subject] => mail_compose test +TEXT +HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:05 +0200
[message_id] => <20130707211605.ae91d5398253309e@myphp.xnd.pl>
[size] => 881
[uid] => 6526
[msgno] => 3
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[3] => Array
(
[subject] => mail_compose test +TEXT -HTML +ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:06 +0200
[message_id] => <20130707211606.e9b496d1bf047c2b@myphp.xnd.pl>
[size] => 18271
[uid] => 6527
[msgno] => 4
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[4] => Array
(
[subject] => mail_compose test -TEXT +HTML +ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:07 +0200
[message_id] => <20130707211607.77876347dacf1064@myphp.xnd.pl>
[size] => 18386
[uid] => 6528
[msgno] => 5
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[5] => Array
(
[subject] => mail_compose test +TEXT +HTML +ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:08 +0200
[message_id] => <20130707211608.8f1129a87e90584e@myphp.xnd.pl>
[size] => 18698
[uid] => 6529
[msgno] => 6
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[6] => Array
(
[subject] => mail_compose test +TEXT +HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:09 +0200
[message_id] => <20130707211609.1bdcc1077fe94101@myphp.xnd.pl>
[size] => 113168
[uid] => 6530
[msgno] => 7
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[7] => Array
(
[subject] => mail_compose test +TEXT +HTML +ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:10 +0200
[message_id] => <20130707211610.b2812b03f93a7686@myphp.xnd.pl>
[size] => 130983
[uid] => 6531
[msgno] => 8
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[8] => Array
(
[subject] => [Fwd: Cron <root@x-cen05> run-parts /etc/cron.daily]
[from] => sp <sp@cen05.xen.wbcd.pl>
[to] => sp <sp@wb.muszelka.pw.edu.pl>
[date] => Thu, 22 Sep 2011 11:25:02 +0200
[message_id] => <4E7AFEEE.3090003@cen05.xen.wbcd.pl>
[size] => 918
[uid] => 6532
[msgno] => 9
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[9] => Array
(
[subject] => [Fwd: Cron <root@x-cen05> run-parts /etc/cron.daily]
[from] => sp <sp@cen05.xen.wbcd.pl>
[to] => sp <sp@wb.muszelka.pw.edu.pl>
[date] => Thu, 22 Sep 2011 11:25:53 +0200
[message_id] => <4E7AFF21.4070407@cen05.xen.wbcd.pl>
[size] => 918
[uid] => 6533
[msgno] => 10
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[10] => Array
(
[subject] => Fwd: test - Redmine ASF
[from] => sp <sp@cen05.xen.wbcd.pl>
[to] => sp <sp@cen06-1.cen05.xen.wbcd.pl>
[date] => Sun, 03 Jun 2012 09:14:55 +0200
[message_id] => <4FCB0EEF.9020304@cen05.xen.wbcd.pl>
[size] => 1039
[uid] => 6534
[msgno] => 11
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[11] => Array
(
[subject] => Undelivered Mail Returned to Sender
[from] => Mail Delivery System <MAILER-DAEMON@cen06x64.xen.wbcd.pl>
[to] => root@cen06x64.xen.wbcd.pl
[date] => Thu, 8 Aug 2013 20:20:54 +0200 (CEST)
[message_id] => <20130808182054.372A347D01@cen06x64.xen.wbcd.pl>
[size] => 2735
[uid] => 6535
[msgno] => 12
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[12] => Array
(
[subject] => test
[from] => sp@xnd
[to] => sp@cen05
[date] => Fri, 16 Aug 2013 17:43:21 +0200 (CEST)
[message_id] => <20130816154321.CB6A7B21A5@cen05.xen.wbcd.pl>
[size] => 487
[uid] => 6536
[msgno] => 13
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[13] => Array
(
[subject] => PHP imap_append test
[from] => user@cen05.xen.wbcd.pl
[to] => sp@cen05.xen.wbcd.pl
[date] => Mon, 02 Sep 2013 07:56:47 +0200 (CEST)
[size] => 201
[uid] => 6539
[msgno] => 14
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[14] => Array
(
[subject] => mail_compose test +TEXT -HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[size] => 347
[uid] => 6540
[msgno] => 15
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[15] => Array
(
[subject] => recent flag test
[from] => user@xnd.muszelka.pw.edu.pl
[to] => sp@cen05.xen.wbcd.pl
[date] => Wed, 4 Sep 2013 22:30:16 +0200
[message_id] => <201309042030.r84KUGsv022203@xnd.muszelka.pw.edu.pl>
[size] => 919
[uid] => 6543
[msgno] => 16
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
)
Zawartość pliku
imap_search2.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$LIST=imap_search($imap, " SUBJECT mail_compose");
print_r($LIST);
$msglist=implode(",",$LIST);
$imapoverview=imap_fetch_overview($imap,$msglist,0);
foreach ($imapoverview as $key=>$val) {
$imapoverview[$key]=get_object_vars($imapoverview[$key]);
}
print_r($imapoverview);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_search2.php
Rezultat wywołania:
resource(1) of type (imap)
Array
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
[4] => 5
[5] => 6
[6] => 7
[7] => 8
[8] => 15
)
Array
(
[0] => Array
(
[subject] => mail_compose test +TEXT -HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[size] => 347
[uid] => 6524
[msgno] => 1
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[1] => Array
(
[subject] => mail_compose test -TEXT +HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:05 +0200
[message_id] => <20130707211605.1bc09f88404f473f@myphp.xnd.pl>
[size] => 464
[uid] => 6525
[msgno] => 2
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[2] => Array
(
[subject] => mail_compose test +TEXT +HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:05 +0200
[message_id] => <20130707211605.ae91d5398253309e@myphp.xnd.pl>
[size] => 881
[uid] => 6526
[msgno] => 3
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[3] => Array
(
[subject] => mail_compose test +TEXT -HTML +ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:06 +0200
[message_id] => <20130707211606.e9b496d1bf047c2b@myphp.xnd.pl>
[size] => 18271
[uid] => 6527
[msgno] => 4
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[4] => Array
(
[subject] => mail_compose test -TEXT +HTML +ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:07 +0200
[message_id] => <20130707211607.77876347dacf1064@myphp.xnd.pl>
[size] => 18386
[uid] => 6528
[msgno] => 5
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[5] => Array
(
[subject] => mail_compose test +TEXT +HTML +ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:08 +0200
[message_id] => <20130707211608.8f1129a87e90584e@myphp.xnd.pl>
[size] => 18698
[uid] => 6529
[msgno] => 6
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[6] => Array
(
[subject] => mail_compose test +TEXT +HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:09 +0200
[message_id] => <20130707211609.1bdcc1077fe94101@myphp.xnd.pl>
[size] => 113168
[uid] => 6530
[msgno] => 7
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[7] => Array
(
[subject] => mail_compose test +TEXT +HTML +ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:10 +0200
[message_id] => <20130707211610.b2812b03f93a7686@myphp.xnd.pl>
[size] => 130983
[uid] => 6531
[msgno] => 8
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[8] => Array
(
[subject] => mail_compose test +TEXT -HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[size] => 347
[uid] => 6540
[msgno] => 15
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
)
Zawartość pliku
imap_search3.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$LIST=imap_search($imap, "SUBJECT mail_compose FROM joe TO example.com ON \"7 Jul 2013\"");
print_r($LIST);
$msglist=implode(",",$LIST);
$imapoverview=imap_fetch_overview($imap,$msglist,0);
foreach ($imapoverview as $key=>$val) {
$imapoverview[$key]=get_object_vars($imapoverview[$key]);
}
print_r($imapoverview);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_search3.php
Rezultat wywołania:
resource(1) of type (imap)
Array
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
[4] => 5
[5] => 6
[6] => 7
[7] => 8
[8] => 15
)
Array
(
[0] => Array
(
[subject] => mail_compose test +TEXT -HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[size] => 347
[uid] => 6524
[msgno] => 1
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[1] => Array
(
[subject] => mail_compose test -TEXT +HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:05 +0200
[message_id] => <20130707211605.1bc09f88404f473f@myphp.xnd.pl>
[size] => 464
[uid] => 6525
[msgno] => 2
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[2] => Array
(
[subject] => mail_compose test +TEXT +HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:05 +0200
[message_id] => <20130707211605.ae91d5398253309e@myphp.xnd.pl>
[size] => 881
[uid] => 6526
[msgno] => 3
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[3] => Array
(
[subject] => mail_compose test +TEXT -HTML +ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:06 +0200
[message_id] => <20130707211606.e9b496d1bf047c2b@myphp.xnd.pl>
[size] => 18271
[uid] => 6527
[msgno] => 4
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[4] => Array
(
[subject] => mail_compose test -TEXT +HTML +ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:07 +0200
[message_id] => <20130707211607.77876347dacf1064@myphp.xnd.pl>
[size] => 18386
[uid] => 6528
[msgno] => 5
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[5] => Array
(
[subject] => mail_compose test +TEXT +HTML +ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:08 +0200
[message_id] => <20130707211608.8f1129a87e90584e@myphp.xnd.pl>
[size] => 18698
[uid] => 6529
[msgno] => 6
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[6] => Array
(
[subject] => mail_compose test +TEXT +HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:09 +0200
[message_id] => <20130707211609.1bdcc1077fe94101@myphp.xnd.pl>
[size] => 113168
[uid] => 6530
[msgno] => 7
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[7] => Array
(
[subject] => mail_compose test +TEXT +HTML +ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:10 +0200
[message_id] => <20130707211610.b2812b03f93a7686@myphp.xnd.pl>
[size] => 130983
[uid] => 6531
[msgno] => 8
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[8] => Array
(
[subject] => mail_compose test +TEXT -HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[size] => 347
[uid] => 6540
[msgno] => 15
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
)
#top imap_set_quota¶
Documentacja online: php.net
imap_set_quota() - Sets a quota for a given mailboxDeklaracja funkcji
imap_set_quota() jest następująca:bool imap_set_quota ( resource $imap_stream , string $quota_root , int $quota_limit )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_set_quota.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$result=imap_set_quota($imap, $mbroot.$mbname, 1048576);
var_dump($result);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_set_quota.php
Rezultat wywołania:
resource(1) of type (imap) bool(false) PHP Notice: Unknown: Quota not available on this IMAP server (errflg=2) in Unknown on line 0 Notice: Unknown: Quota not available on this IMAP server (errflg=2) in Unknown on line 0
#top imap_setacl¶
Documentacja online: php.net
imap_setacl() - Sets the ACL for a giving mailboxDeklaracja funkcji
imap_setacl() jest następująca:bool imap_setacl ( resource $imap_stream , string $mailbox , string $id , string $rights )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_setacl.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$result=imap_setacl($imap, $mbroot.$mbname, "sp", "");
var_dump($result);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_setacl.php
Rezultat wywołania:
resource(1) of type (imap) bool(false) PHP Notice: Unknown: ACL not available on this IMAP server (errflg=2) in Unknown on line 0 Notice: Unknown: ACL not available on this IMAP server (errflg=2) in Unknown on line 0
#top imap_setflag_full¶
Documentacja online: php.net
imap_setflag_full() - Sets flags on messagesDeklaracja funkcji
imap_setflag_full() jest następująca:bool imap_setflag_full ( resource $imap_stream , string $sequence , string $flag [, int $options = NIL ] )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_setflag_full.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$imapoverview=imap_fetch_overview($imap,"1:1",0);
foreach ($imapoverview as $key=>$val) {
$imapoverview[$key]=get_object_vars($imapoverview[$key]);
}
print_r($imapoverview);
$result=imap_setflag_full($imap,"1:1", "\\Seen");
var_dump($result);
$imapoverview=imap_fetch_overview($imap,"1:1",0);
foreach ($imapoverview as $key=>$val) {
$imapoverview[$key]=get_object_vars($imapoverview[$key]);
}
print_r($imapoverview);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_setflag_full.php
Rezultat wywołania:
resource(1) of type (imap)
Array
(
[0] => Array
(
[subject] => mail_compose test +TEXT -HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[size] => 347
[uid] => 6524
[msgno] => 1
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 0
[draft] => 0
)
)
bool(true)
Array
(
[0] => Array
(
[subject] => mail_compose test +TEXT -HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[size] => 347
[uid] => 6524
[msgno] => 1
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
)
#top imap_sort¶
Documentacja online: php.net
imap_sort() - Gets and sort messagesDeklaracja funkcji
imap_sort() jest następująca:array imap_sort ( resource $imap_stream , int $criteria , int $reverse [, int $options = 0 [, string $search_criteria = NULL [, string $charset = NIL ]]] )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_sort1.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$LIST=imap_sort($imap,SORTDATE,0);
print_r($LIST);
$msglist=implode(",",$LIST);
$imapoverview=imap_fetch_overview($imap,$msglist,0);
foreach ($imapoverview as $key=>$val) {
$imapoverview[$key]=get_object_vars($imapoverview[$key]);
}
print_r($imapoverview);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_sort1.php
Rezultat wywołania:
resource(1) of type (imap)
Array
(
[0] => 9
[1] => 10
[2] => 11
[3] => 1
[4] => 15
[5] => 2
[6] => 3
[7] => 4
[8] => 5
[9] => 6
[10] => 7
[11] => 8
[12] => 12
[13] => 13
[14] => 14
[15] => 16
)
Array
(
[0] => Array
(
[subject] => mail_compose test +TEXT -HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[size] => 347
[uid] => 6524
[msgno] => 1
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[1] => Array
(
[subject] => mail_compose test -TEXT +HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:05 +0200
[message_id] => <20130707211605.1bc09f88404f473f@myphp.xnd.pl>
[size] => 464
[uid] => 6525
[msgno] => 2
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[2] => Array
(
[subject] => mail_compose test +TEXT +HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:05 +0200
[message_id] => <20130707211605.ae91d5398253309e@myphp.xnd.pl>
[size] => 881
[uid] => 6526
[msgno] => 3
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[3] => Array
(
[subject] => mail_compose test +TEXT -HTML +ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:06 +0200
[message_id] => <20130707211606.e9b496d1bf047c2b@myphp.xnd.pl>
[size] => 18271
[uid] => 6527
[msgno] => 4
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[4] => Array
(
[subject] => mail_compose test -TEXT +HTML +ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:07 +0200
[message_id] => <20130707211607.77876347dacf1064@myphp.xnd.pl>
[size] => 18386
[uid] => 6528
[msgno] => 5
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[5] => Array
(
[subject] => mail_compose test +TEXT +HTML +ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:08 +0200
[message_id] => <20130707211608.8f1129a87e90584e@myphp.xnd.pl>
[size] => 18698
[uid] => 6529
[msgno] => 6
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[6] => Array
(
[subject] => mail_compose test +TEXT +HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:09 +0200
[message_id] => <20130707211609.1bdcc1077fe94101@myphp.xnd.pl>
[size] => 113168
[uid] => 6530
[msgno] => 7
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[7] => Array
(
[subject] => mail_compose test +TEXT +HTML +ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:10 +0200
[message_id] => <20130707211610.b2812b03f93a7686@myphp.xnd.pl>
[size] => 130983
[uid] => 6531
[msgno] => 8
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[8] => Array
(
[subject] => [Fwd: Cron <root@x-cen05> run-parts /etc/cron.daily]
[from] => sp <sp@cen05.xen.wbcd.pl>
[to] => sp <sp@wb.muszelka.pw.edu.pl>
[date] => Thu, 22 Sep 2011 11:25:02 +0200
[message_id] => <4E7AFEEE.3090003@cen05.xen.wbcd.pl>
[size] => 918
[uid] => 6532
[msgno] => 9
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[9] => Array
(
[subject] => [Fwd: Cron <root@x-cen05> run-parts /etc/cron.daily]
[from] => sp <sp@cen05.xen.wbcd.pl>
[to] => sp <sp@wb.muszelka.pw.edu.pl>
[date] => Thu, 22 Sep 2011 11:25:53 +0200
[message_id] => <4E7AFF21.4070407@cen05.xen.wbcd.pl>
[size] => 918
[uid] => 6533
[msgno] => 10
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[10] => Array
(
[subject] => Fwd: test - Redmine ASF
[from] => sp <sp@cen05.xen.wbcd.pl>
[to] => sp <sp@cen06-1.cen05.xen.wbcd.pl>
[date] => Sun, 03 Jun 2012 09:14:55 +0200
[message_id] => <4FCB0EEF.9020304@cen05.xen.wbcd.pl>
[size] => 1039
[uid] => 6534
[msgno] => 11
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[11] => Array
(
[subject] => Undelivered Mail Returned to Sender
[from] => Mail Delivery System <MAILER-DAEMON@cen06x64.xen.wbcd.pl>
[to] => root@cen06x64.xen.wbcd.pl
[date] => Thu, 8 Aug 2013 20:20:54 +0200 (CEST)
[message_id] => <20130808182054.372A347D01@cen06x64.xen.wbcd.pl>
[size] => 2735
[uid] => 6535
[msgno] => 12
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[12] => Array
(
[subject] => test
[from] => sp@xnd
[to] => sp@cen05
[date] => Fri, 16 Aug 2013 17:43:21 +0200 (CEST)
[message_id] => <20130816154321.CB6A7B21A5@cen05.xen.wbcd.pl>
[size] => 487
[uid] => 6536
[msgno] => 13
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[13] => Array
(
[subject] => PHP imap_append test
[from] => user@cen05.xen.wbcd.pl
[to] => sp@cen05.xen.wbcd.pl
[date] => Mon, 02 Sep 2013 07:56:47 +0200 (CEST)
[size] => 201
[uid] => 6539
[msgno] => 14
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[14] => Array
(
[subject] => mail_compose test +TEXT -HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[size] => 347
[uid] => 6540
[msgno] => 15
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[15] => Array
(
[subject] => recent flag test
[from] => user@xnd.muszelka.pw.edu.pl
[to] => sp@cen05.xen.wbcd.pl
[date] => Wed, 4 Sep 2013 22:30:16 +0200
[message_id] => <201309042030.r84KUGsv022203@xnd.muszelka.pw.edu.pl>
[size] => 919
[uid] => 6543
[msgno] => 16
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
)
Zawartość pliku
imap_sort2.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$LIST=imap_sort($imap,SORTSUBJECT,0);
print_r($LIST);
$msglist=implode(",",$LIST);
$imapoverview=imap_fetch_overview($imap,$msglist,0);
foreach ($imapoverview as $key=>$val) {
$imapoverview[$key]=get_object_vars($imapoverview[$key]);
}
print_r($imapoverview);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_sort2.php
Rezultat wywołania:
resource(1) of type (imap)
Array
(
[0] => 9
[1] => 10
[2] => 6
[3] => 8
[4] => 3
[5] => 7
[6] => 4
[7] => 1
[8] => 15
[9] => 5
[10] => 2
[11] => 14
[12] => 16
[13] => 13
[14] => 11
[15] => 12
)
Array
(
[0] => Array
(
[subject] => mail_compose test +TEXT -HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[size] => 347
[uid] => 6524
[msgno] => 1
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[1] => Array
(
[subject] => mail_compose test -TEXT +HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:05 +0200
[message_id] => <20130707211605.1bc09f88404f473f@myphp.xnd.pl>
[size] => 464
[uid] => 6525
[msgno] => 2
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[2] => Array
(
[subject] => mail_compose test +TEXT +HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:05 +0200
[message_id] => <20130707211605.ae91d5398253309e@myphp.xnd.pl>
[size] => 881
[uid] => 6526
[msgno] => 3
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[3] => Array
(
[subject] => mail_compose test +TEXT -HTML +ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:06 +0200
[message_id] => <20130707211606.e9b496d1bf047c2b@myphp.xnd.pl>
[size] => 18271
[uid] => 6527
[msgno] => 4
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[4] => Array
(
[subject] => mail_compose test -TEXT +HTML +ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:07 +0200
[message_id] => <20130707211607.77876347dacf1064@myphp.xnd.pl>
[size] => 18386
[uid] => 6528
[msgno] => 5
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[5] => Array
(
[subject] => mail_compose test +TEXT +HTML +ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:08 +0200
[message_id] => <20130707211608.8f1129a87e90584e@myphp.xnd.pl>
[size] => 18698
[uid] => 6529
[msgno] => 6
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[6] => Array
(
[subject] => mail_compose test +TEXT +HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:09 +0200
[message_id] => <20130707211609.1bdcc1077fe94101@myphp.xnd.pl>
[size] => 113168
[uid] => 6530
[msgno] => 7
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[7] => Array
(
[subject] => mail_compose test +TEXT +HTML +ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:10 +0200
[message_id] => <20130707211610.b2812b03f93a7686@myphp.xnd.pl>
[size] => 130983
[uid] => 6531
[msgno] => 8
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[8] => Array
(
[subject] => [Fwd: Cron <root@x-cen05> run-parts /etc/cron.daily]
[from] => sp <sp@cen05.xen.wbcd.pl>
[to] => sp <sp@wb.muszelka.pw.edu.pl>
[date] => Thu, 22 Sep 2011 11:25:02 +0200
[message_id] => <4E7AFEEE.3090003@cen05.xen.wbcd.pl>
[size] => 918
[uid] => 6532
[msgno] => 9
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[9] => Array
(
[subject] => [Fwd: Cron <root@x-cen05> run-parts /etc/cron.daily]
[from] => sp <sp@cen05.xen.wbcd.pl>
[to] => sp <sp@wb.muszelka.pw.edu.pl>
[date] => Thu, 22 Sep 2011 11:25:53 +0200
[message_id] => <4E7AFF21.4070407@cen05.xen.wbcd.pl>
[size] => 918
[uid] => 6533
[msgno] => 10
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[10] => Array
(
[subject] => Fwd: test - Redmine ASF
[from] => sp <sp@cen05.xen.wbcd.pl>
[to] => sp <sp@cen06-1.cen05.xen.wbcd.pl>
[date] => Sun, 03 Jun 2012 09:14:55 +0200
[message_id] => <4FCB0EEF.9020304@cen05.xen.wbcd.pl>
[size] => 1039
[uid] => 6534
[msgno] => 11
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[11] => Array
(
[subject] => Undelivered Mail Returned to Sender
[from] => Mail Delivery System <MAILER-DAEMON@cen06x64.xen.wbcd.pl>
[to] => root@cen06x64.xen.wbcd.pl
[date] => Thu, 8 Aug 2013 20:20:54 +0200 (CEST)
[message_id] => <20130808182054.372A347D01@cen06x64.xen.wbcd.pl>
[size] => 2735
[uid] => 6535
[msgno] => 12
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[12] => Array
(
[subject] => test
[from] => sp@xnd
[to] => sp@cen05
[date] => Fri, 16 Aug 2013 17:43:21 +0200 (CEST)
[message_id] => <20130816154321.CB6A7B21A5@cen05.xen.wbcd.pl>
[size] => 487
[uid] => 6536
[msgno] => 13
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[13] => Array
(
[subject] => PHP imap_append test
[from] => user@cen05.xen.wbcd.pl
[to] => sp@cen05.xen.wbcd.pl
[date] => Mon, 02 Sep 2013 07:56:47 +0200 (CEST)
[size] => 201
[uid] => 6539
[msgno] => 14
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[14] => Array
(
[subject] => mail_compose test +TEXT -HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[size] => 347
[uid] => 6540
[msgno] => 15
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
[15] => Array
(
[subject] => recent flag test
[from] => user@xnd.muszelka.pw.edu.pl
[to] => sp@cen05.xen.wbcd.pl
[date] => Wed, 4 Sep 2013 22:30:16 +0200
[message_id] => <201309042030.r84KUGsv022203@xnd.muszelka.pw.edu.pl>
[size] => 919
[uid] => 6543
[msgno] => 16
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
)
#top imap_status¶
Documentacja online: php.net
imap_status() - Returns status information on a mailboxDeklaracja funkcji
imap_status() jest następująca:object imap_status ( resource $imap_stream , string $mailbox , int $options )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_status.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$MBINFO=imap_status($imap, $mbroot."INBOX", SA_ALL);
var_dump($MBINFO);
print_r($MBINFO);
$MBINFO=get_object_vars($MBINFO);
print_r($MBINFO);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_status.php
Rezultat wywołania:
resource(1) of type (imap)
object(stdClass)#1 (6) {
["flags"]=>
int(31)
["messages"]=>
int(16)
["recent"]=>
int(0)
["unseen"]=>
int(0)
["uidnext"]=>
int(6544)
["uidvalidity"]=>
int(1314820984)
}
stdClass Object
(
[flags] => 31
[messages] => 16
[recent] => 0
[unseen] => 0
[uidnext] => 6544
[uidvalidity] => 1314820984
)
Array
(
[flags] => 31
[messages] => 16
[recent] => 0
[unseen] => 0
[uidnext] => 6544
[uidvalidity] => 1314820984
)
#top imap_subscribe¶
Documentacja online: php.net
imap_subscribe() - Subscribe to a mailboxDeklaracja funkcji
imap_subscribe() jest następująca:bool imap_subscribe ( resource $imap_stream , string $mailbox )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_subscribe.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$result=imap_subscribe($imap, $mbroot."sunbird");
var_dump($result);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_subscribe.php
Rezultat wywołania:
resource(1) of type (imap) bool(true)
Sposób ponownego wywołania:
php -f imap_subscribe.php
Rezultat ponownego wywołania:
resource(1) of type (imap) bool(true)
#top imap_thread¶
Documentacja online: php.net
imap_thread() - Returns a tree of threaded messageDeklaracja funkcji
imap_thread() jest następująca:array imap_thread ( resource $imap_stream [, int $options = SE_FREE ] )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_thread.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$THREAD=imap_thread($imap);
var_dump($THREAD);
print_r($THREAD);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_thread.php
Rezultat wywołania:
resource(1) of type (imap)
array(60) {
["0.num"]=>
int(0)
["0.next"]=>
int(1)
["1.num"]=>
int(9)
["1.next"]=>
int(0)
["1.branch"]=>
int(2)
["2.num"]=>
int(10)
["2.next"]=>
int(0)
["2.branch"]=>
int(0)
["0.branch"]=>
int(3)
["3.num"]=>
int(11)
["3.next"]=>
int(0)
["3.branch"]=>
int(4)
["4.num"]=>
int(0)
["4.next"]=>
int(5)
["5.num"]=>
int(1)
["5.next"]=>
int(0)
["5.branch"]=>
int(6)
["6.num"]=>
int(15)
["6.next"]=>
int(0)
["6.branch"]=>
int(0)
["4.branch"]=>
int(7)
["7.num"]=>
int(2)
["7.next"]=>
int(0)
["7.branch"]=>
int(8)
["8.num"]=>
int(0)
["8.next"]=>
int(9)
["9.num"]=>
int(3)
["9.next"]=>
int(0)
["9.branch"]=>
int(10)
["10.num"]=>
int(7)
["10.next"]=>
int(0)
["10.branch"]=>
int(0)
["8.branch"]=>
int(11)
["11.num"]=>
int(4)
["11.next"]=>
int(0)
["11.branch"]=>
int(12)
["12.num"]=>
int(5)
["12.next"]=>
int(0)
["12.branch"]=>
int(13)
["13.num"]=>
int(0)
["13.next"]=>
int(14)
["14.num"]=>
int(6)
["14.next"]=>
int(0)
["14.branch"]=>
int(15)
["15.num"]=>
int(8)
["15.next"]=>
int(0)
["15.branch"]=>
int(0)
["13.branch"]=>
int(16)
["16.num"]=>
int(12)
["16.next"]=>
int(0)
["16.branch"]=>
int(17)
["17.num"]=>
int(13)
["17.next"]=>
int(0)
["17.branch"]=>
int(18)
["18.num"]=>
int(14)
["18.next"]=>
int(0)
["18.branch"]=>
int(19)
["19.num"]=>
int(16)
["19.next"]=>
int(0)
["19.branch"]=>
int(0)
}
Array
(
[0.num] => 0
[0.next] => 1
[1.num] => 9
[1.next] => 0
[1.branch] => 2
[2.num] => 10
[2.next] => 0
[2.branch] => 0
[0.branch] => 3
[3.num] => 11
[3.next] => 0
[3.branch] => 4
[4.num] => 0
[4.next] => 5
[5.num] => 1
[5.next] => 0
[5.branch] => 6
[6.num] => 15
[6.next] => 0
[6.branch] => 0
[4.branch] => 7
[7.num] => 2
[7.next] => 0
[7.branch] => 8
[8.num] => 0
[8.next] => 9
[9.num] => 3
[9.next] => 0
[9.branch] => 10
[10.num] => 7
[10.next] => 0
[10.branch] => 0
[8.branch] => 11
[11.num] => 4
[11.next] => 0
[11.branch] => 12
[12.num] => 5
[12.next] => 0
[12.branch] => 13
[13.num] => 0
[13.next] => 14
[14.num] => 6
[14.next] => 0
[14.branch] => 15
[15.num] => 8
[15.next] => 0
[15.branch] => 0
[13.branch] => 16
[16.num] => 12
[16.next] => 0
[16.branch] => 17
[17.num] => 13
[17.next] => 0
[17.branch] => 18
[18.num] => 14
[18.next] => 0
[18.branch] => 19
[19.num] => 16
[19.next] => 0
[19.branch] => 0
)
#top imap_timeout¶
Documentacja online: php.net
imap_timeout() - Set or fetch imap timeoutDeklaracja funkcji
imap_timeout() jest następująca:mixed imap_timeout ( int $timeout_type [, int $timeout = -1 ] )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_timeout.php:SELECT ALL
<?php
$tmoutopen=imap_timeout(IMAP_OPENTIMEOUT);
$tmoutread=imap_timeout(IMAP_READTIMEOUT);
$tmoutwrite=imap_timeout(IMAP_WRITETIMEOUT);
$tmoutclose=imap_timeout(IMAP_CLOSETIMEOUT);
echo("tmoutopen=$tmoutopen\n");
echo("tmoutread=$tmoutread\n");
echo("tmoutwrite=$tmoutwrite\n");
echo("tmoutclose=$tmoutclose\n");
?>
Sposób wywołania:
php -f imap_timeout.php
Rezultat wywołania:
tmoutopen=60 tmoutread=60 tmoutwrite=60 tmoutclose=0
#top imap_uid¶
Documentacja online: php.net
imap_uid() - This function returns the UID for the given message sequence numberDeklaracja funkcji
imap_uid() jest następująca:int imap_uid ( resource $imap_stream , int $msg_number )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_uid.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$msgno1=1;
$msgno2=2;
$msgno3=3;
$uid1=imap_uid($imap,$msgno1);
$uid2=imap_uid($imap,$msgno2);
$uid3=imap_uid($imap,$msgno3);
echo("msgno1=$msgno1 uid1=$uid1\n");
echo("msgno2=$msgno2 uid2=$uid2\n");
echo("msgno3=$msgno3 uid3=$uid3\n");
imap_close($imap);
?>
Sposób wywołania:
php -f imap_uid.php
Rezultat wywołania:
resource(1) of type (imap) msgno1=1 uid1=6524 msgno2=2 uid2=6525 msgno3=3 uid3=6526
#top imap_undelete¶
Documentacja online: php.net
imap_undelete() - Unmark the message which is marked deletedDeklaracja funkcji
imap_undelete() jest następująca:bool imap_undelete ( resource $imap_stream , int $msg_number [, int $flags = 0 ] )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_undelete.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$imapoverview=imap_fetch_overview($imap,"1:1",0);
foreach ($imapoverview as $key=>$val) {
$imapoverview[$key]=get_object_vars($imapoverview[$key]);
}
print_r($imapoverview);
$result=imap_undelete($imap,1);
var_dump($result);
$imapoverview=imap_fetch_overview($imap,"1:1",0);
foreach ($imapoverview as $key=>$val) {
$imapoverview[$key]=get_object_vars($imapoverview[$key]);
}
print_r($imapoverview);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_undelete.php
Rezultat wywołania:
resource(1) of type (imap)
Array
(
[0] => Array
(
[subject] => mail_compose test +TEXT -HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[size] => 347
[uid] => 6524
[msgno] => 1
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 1
[seen] => 1
[draft] => 0
)
)
bool(true)
Array
(
[0] => Array
(
[subject] => mail_compose test +TEXT -HTML -ATTACH
[from] => joe@example.com
[to] => foo@example.com
[date] => Sun, 7 Jul 2013 21:16:04 +0200
[message_id] => <20130707211604.a18224b8d4cf3ce3@myphp.xnd.pl>
[size] => 347
[uid] => 6524
[msgno] => 1
[recent] => 0
[flagged] => 0
[answered] => 0
[deleted] => 0
[seen] => 1
[draft] => 0
)
)
Jak widać na powyższym przykładzie wywołanie funkcji
imap_undelete() usunięcie flagi \\Deleted wiadomości, którą wiadomość została oznaczona jako do skasowana, pod warunkiem że nie została wywołana funkcja imap_expunge() na bieżącej skrzynce w której wiadomość została skasowana. Aby odzyskać skasowaną wiadomość najpierw należy ją skasować poprzez wywołanie przeciwnej funkcji imap_delete().#top imap_unsubscribe¶
Documentacja online: php.net
imap_unsubscribe() - Unsubscribe from a mailboxDeklaracja funkcji
imap_unsubscribe() jest następująca:bool imap_unsubscribe ( resource $imap_stream , string $mailbox )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_unsubscribe.php:SELECT ALL
<?php
$mbroot="{cen05.xen.wbcd.pl/tls/novalidate-cert}";
$mbname="INBOX";
$imap=imap_open("$mbroot$mbname","sp","asdfgh");
var_dump($imap);
$result=imap_unsubscribe($imap, $mbroot."sunbird");
var_dump($result);
imap_close($imap);
?>
Sposób wywołania:
php -f imap_unsubscribe.php
Rezultat wywołania:
resource(1) of type (imap) bool(true)
Sposób ponownego wywołania:
php -f imap_unsubscribe.php
Rezultat ponownego wywołania:
resource(1) of type (imap) bool(true)
#top imap_utf7_decode¶
Documentacja online: php.net
imap_utf7_decode() - Decodes a modified UTF-7 encoded stringDeklaracja funkcji
imap_utf7_decode() jest następująca:string imap_utf7_decode ( string $text )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_utf7_decode.php:SELECT ALL
<?php
$textcont="ala &xITEhsSYxYHFg8OTxZrFucW7- ma &xIXEh8SZxYLFhMOzxZvFusW8- kota";
$textimap=imap_utf7_decode($textcont);
echo("textcont=|$textcont|\n");
echo("textimap=|$textimap|\n");
?>
Sposób wywołania:
php -f imap_utf7_decode.php
Rezultat wywołania:
textcont=|ala &xITEhsSYxYHFg8OTxZrFucW7- ma &xIXEh8SZxYLFhMOzxZvFusW8- kota| textimap=|ala ĄĆĘŁŃÓŚŹŻ ma ąćęłńóśźż kota|
#top imap_utf7_encode¶
Documentacja online: php.net
imap_utf7_encode() - Converts ISO-8859-1 string to modified UTF-7 textDeklaracja funkcji
imap_utf7_encode() jest następująca:string imap_utf7_encode ( string $data )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_utf7_encode.php:SELECT ALL
<?php
$textcont="ala ĄĆĘŁŃÓŚŹŻ ma ąćęłńóśźż kota";
$textimap=imap_utf7_encode($textcont);
echo("textcont=|$textcont|\n");
echo("textimap=|$textimap|\n");
?>
Sposób wywołania:
php -f imap_utf7_encode.php
Rezultat wywołania:
textcont=|ala ĄĆĘŁŃÓŚŹŻ ma ąćęłńóśźż kota| textimap=|ala &xITEhsSYxYHFg8OTxZrFucW7- ma &xIXEh8SZxYLFhMOzxZvFusW8- kota|
#top imap_utf8¶
Documentacja online: php.net
imap_utf8() - Converts MIME-encoded text to UTF-8Deklaracja funkcji
imap_utf8() jest następująca:string imap_utf8 ( string $mime_encoded_text )
Powiązane:
imap_open(),
Opis:
Funkcja ()
Argumenty:
arg -
Zwracana wartość:
type -
Argumenty:
arg -
Zwracana wartość:
type -
Examples:
Zawartość pliku
imap_utf8.php:SELECT ALL
<?php
$textcont="ala ĄĆĘŁŃÓŚŹŻ ma ąćęłńóśźż kota";
$textquot=quoted_printable_encode($textcont);
$textquot="=?UTF-8?Q?$textquot?=";
$textimap=imap_utf8($textquot);
echo("textcont=|$textcont|\n");
echo("textquot=|$textquot|\n")
echo("textimap=|$textimap|\n");
?>
Sposób wywołania:
php -f imap_utf8.php
Rezultat wywołania:
textcont=|ala ĄĆĘŁŃÓŚŹŻ ma ąćęłńóśźż kota| textquot=|=?UTF-8?Q?ala=20=C4=84=C4=86=C4=98=C5=81=C5=83=C3=93=C5=9A=C5=B9=C5=BB=20ma=20=C4=85=C4=87=C4=99=C5=82=C5=84=C3=B3=C5=9B=C5=BA=C5=BC=20kota?=| textimap=|ala ĄĆĘŁŃÓŚŹŻ ma ąćęłńóśźż kota|
Zmodyfikowany ostatnio: 2013/11/20 22:42:16 (11 lat temu),
textsize: 187 kB,
htmlsize: 243 kB
Zapraszam do komentowania, zgłaszania sugestii, propozycji, własnych przykładów, ...
Dodaj komentarzKomentarze użytkowników
