+ if (containsType($msg, "text", "html", $ent_num)) {
+ $body = decodeBody($msg["ENTITIES"][$ent_num]["BODY"], $msg["ENTITIES"][$ent_num]["ENCODING"], false);
+ } else if (containsType($msg, "text", "plain", $ent_num)) {
+ $body = decodeBody($msg["ENTITIES"][$ent_num]["BODY"], $msg["ENTITIES"][$ent_num]["ENCODING"], false);
+ }
+ // add other primary displaying msg types here
+ else {
+ // find any type that's displayable
+ if (containsType($msg, "text", "any_type", $ent_num)) {
+ $body = decodeBody($msg["ENTITIES"][$ent_num]["BODY"], $msg["ENTITIES"][$ent_num]["ENCODING"], false);
+ } else if (containsType($msg, "msg", "any_type", $ent_num)) {
+ $body = decodeBody($msg["ENTITIES"][$ent_num]["BODY"], $msg["ENTITIES"][$ent_num]["ENCODING"], false);
+ } else {
+ $body = "No Message";
+ }
+ }
+
+ $type1 = $msg["ENTITIES"][$ent_num]["TYPE1"];
+
+ $body_ary = explode("\n", $body);
+ $body = "";