diff --git a/src/MessageManagement/Mail.php b/src/MessageManagement/Mail.php index 25e05cc..524e5c3 100644 --- a/src/MessageManagement/Mail.php +++ b/src/MessageManagement/Mail.php @@ -100,18 +100,16 @@ public function toApiParams() } elseif ($body instanceof MimeMessage) { $parts = $body->getParts(); - if (count($parts) > 2) { - throw new RuntimeException( - 'Currently, only text/plain and text/html MIME parts - are supported' - ); - } - foreach ($parts as $part) { if ($part->type == 'text/plain') { $params['bodytext'] = $part->getRawContent(); } elseif ($part->type == 'text/html') { $params['bodyhtml'] = $part->getRawContent(); + } else { + throw new RuntimeException( + 'Currently, only text/plain and text/html MIME parts + are supported' + ); } } }