The top-level $msg is a multipart/alternative; use $txn->content for the body