Rumah > Artikel > pembangunan bahagian belakang > IMap获取信件内容如何筛选邮件?哪位高手做过?请问了
IMap获取信件内容怎么筛选邮件??谁做过?请教了
<?php<br /> <br /> require_once('../ImapMailbox.php');<br /> <br /> // IMAP must be enabled in Google Mail Settings<br /> define('GMAIL_EMAIL', '');<br /> define('GMAIL_PASSWORD', '');<br /> define('ATTACHMENTS_DIR', dirname(__FILE__) . '/attachments');<br /> <br /> $mailbox = new ImapMailbox('{xxxx/notls}INBOX', GMAIL_EMAIL, GMAIL_PASSWORD, ATTACHMENTS_DIR, 'utf-8');<br /> $mails = array();<br /> <br /> foreach($mailbox->searchMails('ALL') as $mailId) {<br /> $mail = $mailbox->getMail($mailId);<br /> // $mailbox->setMailAsSeen($mail->mId);<br /> // $mailbox->deleteMail($mail->mId);<br /> $mails[] = $mail;<br /> }<br /> echo "<pre class="brush:php;toolbar:false">";<br /> var_dump($mails);