diff --git a/includes/mail.inc b/includes/mail.inc
index abef0fe..f148671 100644
--- a/includes/mail.inc
+++ b/includes/mail.inc
@@ -336,7 +336,8 @@ function drupal_wrap_mail($text, $indent = '') {
   $text = preg_replace('/^(>| |From)/m', ' $1', $text);
   // Apply indentation. We only include non-'>' indentation on the first line.
   $text = $indent . substr(preg_replace('/^/m', $clean_indent, $text), strlen($indent));
-
+  // Ensure line ends in a newline character.
+  $text = preg_replace('/(?!=\n)$/', "\n", $text);
   return $text;
 }
 
