Well php imap's function are not fun to work with. A user on this page explains the inconsistencies with getting emails: http://php.net/manual/en/function.imap-fetchbody.php#89002
Using his helpful information I created a reliably way to get an email's body text.
$bodyText = imap_fetchbody($connection,$emailnumber,1.2);
if(!strlen($bodyText)>0){
$bodyText = imap_fetchbody($connection,$emailnumber,1);
}
$subject = imap_headerinfo($connection,$i);
$subject = $subject->subject;
echo $subject."
".$bodyText;
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…