I spent hours religously thinking that
imap_fetchbody($mbox,$email_number,1.2)
would fetch the html body, and in many cases this did not work. It turns out that simple message can have a simple [parts] stucture so this became true:
imap_fetchbody($mbox,$email_number,1) - PLAIN
imap_fetchbody($inbox,$email_number,2) - HTML
Check for empty string before using the latter.