diff --git a/src/ContactEmailerServiceProvider.php b/src/ContactEmailerServiceProvider.php
index 1de6ccf..6a8bd79 100644
--- a/src/ContactEmailerServiceProvider.php
+++ b/src/ContactEmailerServiceProvider.php
@@ -11,6 +11,7 @@ use Drupal\Component\Render\FormattableMarkup;
 use Egulias\EmailValidator\EmailValidator;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\Core\Mail\MailFormatHelper;
+use Drupal\filter\Entity\FilterFormat;
 
 /**
  * Class ContactEmailerServiceProvider.
@@ -137,12 +138,19 @@ class ContactEmailerServiceProvider {
           continue;
         }
 
-        // Subject and body.
+        // Subject.
         $params['subject'] = $this->setSubject($email->subject);
-        $params['message'] = $this->setBody($email->body);
 
-        // Set to html mail by default.
-        $params['format'] = 'text/html';
+        // Body.
+        if ($email->body && $body = unserialize($email->body)) {
+          $params['format'] = $this->setFormat($body);
+          $params['message'] = $this->setBody($body, $params['format']);
+        }
+        else {
+          $params['format'] = 'text/plain';
+          $params['message'] = '';
+        }
+        dpm($params);
 
         // Final prep and send.
         $langcode = $this->currentUser->getPreferredLangcode();
@@ -329,29 +337,23 @@ class ContactEmailerServiceProvider {
    *
    * @var mixed $body
    *   A string or text format array.
+   * @var string $format
+   *   The email format.
    *
    * @return string
    *   The rendered html or plain text.
    */
-  protected function setBody($body) {
-    if (!$body) {
-      return '';
-    }
-
-    $body = unserialize($body);
-
-    // Render based on text format.
-    if (!is_array($body)) {
+  protected function setBody($body, $format) {
 
-      // No text format, plain text.
-      $body = [
+    // Prepare render array based on text format.
+    if ($format == 'text/plain' || !is_array($body)) {
+      $body = (is_array($body) ? $body['value'] : $body);
+      $build = [
         '#plain_text' => $this->tokenizeString($body),
       ];
     }
     else {
-
-      // Has a text format, process the text.
-      $body = [
+      $build = [
         '#type' => 'processed_text',
         '#format' => $body['format'],
         '#text' => $this->tokenizeString($body['value']),
@@ -359,10 +361,36 @@ class ContactEmailerServiceProvider {
     }
 
     // Render the body.
-    $rendered_body = $this->renderer->render($body);
+    $rendered = $this->renderer->render($build);
 
     // Send FormattableMarkup to ensure SwiftMailer doesn't further escape it.
-    return new FormattableMarkup($rendered_body, []);
+    return new FormattableMarkup($rendered, []);
+  }
+
+  /**
+   * Set the email format.
+   *
+   * @var mixed $body
+   *   A string or text format array.
+   *
+   * @return string
+   *   The email format.
+   */
+  protected function setFormat($body) {
+
+    // Get selected format.
+    if (is_array($body) && isset($body['format']) && $format = FilterFormat::load($body['format'])) {
+
+      // If the selected format does not allow html, set the email as plain
+      // text.
+      $restrictions = $format->getHtmlRestrictions();
+      if (!$restrictions['allowed']) {
+        return 'text/plain';
+      }
+    }
+
+    // Default to html.
+    return 'text/html';
   }
 
   /**
