メールをチェックしてデータベースに入れるスクリプトがあります。これは、新しい電子メールが作成されて送信されるときに正常に機能します。ただし、電子メールに返信すると、imap_fetchbody が機能せず、空になります。
ここでどこが間違っていますか?
/* get information specific to this email */
$overview = imap_fetch_overview($inbox,$email_number,0);
$structure = imap_fetchstructure($inbox,$email_number);
$message = imap_fetchbody($inbox,$email_number,0);
$header = imap_headerinfo($inbox,$email_number);
//print_r($structure);
//make sure emails are read or do nothing
if($overview[0]->seen = 'read'){
//strip everything below line
$param="## In replies all text above this line is added to the ticket ##";
$strip_func = strpos($message, $param);
$message_new = substr($message,0,$strip_func );
/* output the email body */
$output.= '<div class="body">'.$message_new.'<br><br></div>';
$message_new の代わりに $message を出力すると、テキストの削除を開始する前にすべてが表示されます。