diff --git a/mail.php b/mail.php index e8e75fd..eac4a81 100644 --- a/mail.php +++ b/mail.php @@ -735,6 +735,8 @@ class mail public function addAttachment ($name, $fileContent, $encoding="base64", $inline=false) { + if ($this->getBodyHTML() === false && $inline !== false) + $this->setBodyHTML ("No HTML provided by inline file added"); // Look if there is a multipart/mixed where adding the new section. If not, // create it $multipart = ($inline === false) ? "multipart/mixed" : "multipart/related"; @@ -1252,6 +1254,9 @@ class mail */ public function getMail () { + if (trim ($this->getBodyHTML()) === "No HTML provided by inline file added") + throw new \Exception ("No HTML provided by inline file added", 500); + return $this->completeEmailEML; }