This is my code.
Yes it may look a bit untidy, but that is not the problem. The problem I'm having is that if the email (sent from outlook '07) does not have an attachment I don't get anything but a nasty looking plain text email. If I do have an attachment on the email then I get lovely colored formatted email.PHP Code:$message = imap_fetchbody($inbox, $email_number, 1.2);
if ($message == "") {
$message = imap_fetchbody($inbox, $email_number, 1.1);
}
if ($message == "") {
$message = imap_fetchbody($inbox, $email_number, 1);
}
$FindHashes = stripos($message, "####");
$StaffMessage = (substr($message,0,$FindHashes))."</body></html>";
$StaffMessage = quoted_printable_decode($StaffMessage);
$StaffMessage = htmlspecialchars($StaffMessage, ENT_QUOTES);
FYI I am decoding the htmlspecialchars before I display them.
How do I get a nice email if there is nothing attached?
Thanks in advance![]()




Reply With Quote
