php imap函数,Imap是什么意思,php imap 函数详解(2)

返回值: 整数

函数种类: 网络系统

内容说明: 本函数用来删除已加入删除标记的邮件。欲标记邮件须使用 imap_delete() 函数。

imap_fetchbody

从信件内文取出指定部分。

语法: string imap_fetchbody(int imap_stream, int msg_number, string part_number, flags [flags]);

返回值: 字符串

函数种类: 网络系统

内容说明: 本函数可读取信件的内文 (body) 部份。参数 imap_stream 为 imap 的代号。参数 msg_number 为信件的序号。参数 part_number 为指定的部分。参数 flags 可省略,有下列的值

ft_uid : 信件序号为 uid。

ft_peek : 若无配置 \seen 标志则不要设本标志。

ft_internal : 返回字符串使用系统格式,不要刻意转成 crlf 行结束标准。

imap_fetchstructure

获取某信件的结构信息。

语法: array imap_fetchstructure(int imap_stream, int msg_number);

返回值: 数组

函数种类: 网络系统

内容说明

本函数可读取指定信件的相关信息。参数 imap_stream 为 imap 的代号。参数 msg_number 为信件的序号。返回的信息为数组的方式,各元素的内容见下表

type 整数 (integer)encoding整数 (integer)ifsubtype布尔 (boolean)subtype字符串 (string)ifdescription布尔 (boolean)description字符串 (string)ifid布尔 (boolean)id字符串 (string)lines整数 (integer)bytes整数 (integer)ifparameters布尔 (boolean)

元素名称 类型

其中 type 元素的值代表的意义如下 0文字 text1复合 multipart2信息 message3程序 application4声音 audio5图形 image6影像 video7其它 other

值 代表意义

而 encoding 值代表的意义如下 0七位 (7 bit)1八位 (8 bit)2二进位 (binary)3base64 编码4qp 编码 (quotedprintable)5其它

值 代表意义

imap_header

获取某信件的标头信息。

语法: object imap_header(int imap_stream, int msg_number, int [fromlength], int [subjectlength], int [defaulthost]);

返回值: 类

函数种类: 网络系统

内 容说明: 本函数可读取指定信件的标头信息。 msg_number 为信件的序号。返回类有下列的属性:answered、bcc、bccaddress、cc、ccaddress、date、date、deleted、 fetchfrom、fetchsubject、flagged、followup_to、from、fromaddress、in_reply_to、 maildate、message_id、msgno、newsgroups、recent、references、remail、reply_to、 reply_toaddress、return_path、return_pathaddress、sender、senderaddress、 size、subject、subject、to、toaddress、udate、unseen。

imap_headers

获取全部信件的标头信息。

语法: array imap_headers(int imap_stream);

返回值: 数组

函数种类: 网络系统

内容说明: 本函数可读取全部信件的标头信息。参数 imap_stream 为 imap 的代号。返回的数组一个元素为某一封信的标头。

使用范例

$mb = imap_open(“{my.imap.com.tw}inbox”, “wilson”, “mypasswd”);

$allheaders = imap_headers($mb);

imap_close($mb);

echo ”

\n";

for ($i=0; $i < count($allheaders); $i++) {

echo $allheaders[$i]."

\n";

}

echo "

\n”;

?>

imap_listmailbox

获取邮箱列示。

语法: array imap_listmailbox(int stream_id, string ref, string pattern);

返回值: 数组

函数种类: 网络系统

内 容说明: 本函数可获得邮箱列示。参数 imap_stream 为 imap 的代号。参数 ref 通常为 imap 服务器名称,参考下例。参数 pattern 可用万用字符 * 代表全部的路径,aayawa@yahoo.com 并指出 (27-apr-1999) 若本参数以 “” (空字符) 代入,不会返回资料。

使用范例

本例为 alank@shermanloan.com 于 02-jun-1999 所提出的。

$account = “myid”;

$password= “mypasswd”;

$mailbox = imap_open(“{mail.xyz.com:143}inbox”, $account, $password);

if ($mailbox) {

$mailboxes = imap_listmailbox($mailbox, “{mail.xyz.com:143}”, “*”);

for ($index = 0; $index < count($mailboxes); $index++) { print($mailboxes[$index] . “\n”); } imap_close($mailbox); } else { print(“无法?/font>}启 $account 的信箱.\n”);

}

?>

imap_listsubscribed

获取订阅邮箱列示。

语法: array imap_listsubscribed(int stream_id, string ref, string pattern);

返回值: 数组

函数种类: 网络系统

内容说明: 本函数可获得订阅邮箱 (subscribed) 列示。参数 imap_stream 为 imap 的代号。参数 ref 通常为 imap 服务器名称。参数 pattern 可用万用字符 * 代表全部的路径。

参考 imap_listmailbox() imap_subscribe() imap_unsubscribe()

imap_mail_copy

复制指定信件到它处邮箱。

语法: int imap_mail_copy(int imap_stream, string msglist, string mbox, int [flags]);

返回值: 整数

函数种类: 网络系统

内 容说明: 本函数复制指定的信件到指定的邮箱 (mailbox) 之中。参数 imap_stream 为 imap 的代号。参数 msglist 可以是信件号序,也可以是范围。参数 mbox 为复制的目的邮箱。参数 flags 可省略,有二种选择 cp_uid,cp_move。

imap_mail_move

移动指定信件到它处邮箱。

语法: int imap_mail_move(int imap_stream, string msglist, string mbox);

返回值: 整数

函数种类: 网络系统

内容说明: 本函数移动指定的信件到指定的邮箱 (mailbox) 之中。参数 imap_stream 为 imap 的代号。参数 msglist 可以是信件号序,也可以是范围。参数 mbox 为移动的目的邮箱。

imap_num_msg

取得信件数。

语法: int imap_num_msg(int imap_stream);

返回值: 整数

函数种类: 网络系统

内容说明: 本函数可取得邮箱 (mailbox) 的信件数。参数 imap_stream 为 imap 的代号。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值