You should you use the foreachPart() part function to iterate through the message parts.