本文整理匯總了PHP中EmailMessage::fetch方法的典型用法代碼示例。如果您正苦於以下問題:PHP EmailMessage::fetch方法的具體用法?PHP EmailMessage::fetch怎麽用?PHP EmailMessage::fetch使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類EmailMessage
的用法示例。
在下文中一共展示了EmailMessage::fetch方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: EmailMessage
function fetch_message($client, $uid)
{
$structure = imap_fetchstructure($client, $uid, FT_UID);
//Check if email is plaintext or MIME type
if ($structure->type) {
//The message is not just plaintext
$emailMessage = new EmailMessage($client, $uid);
$emailMessage->fetch();
process_inline($emailMessage);
$data = $emailMessage->bodyHTML;
} else {
//Is the message a reply?
$email_header = imap_fetch_overview($client, $uid, FT_UID)[0];
//The message is plaintext
if (!isset($email_header->in_reply_to)) {
$data = imap_fetchbody($client, $uid, 1, FT_UID);
} else {
// Message is a reply, need to format returned value
$data = imap_fetchbody($client, $uid, 1, FT_UID);
if (preg_match('/>\\s\\t*On/im', $data)) {
$data = preg_replace('/>\\s\\t*On/im', '<br/><div class="collapse"> > On', $data);
$data .= '</div>';
}
}
}
return $data;
}