diff --git a/mimemail.module b/mimemail.module
index 844dafc..bce7f06 100644
--- a/mimemail.module
+++ b/mimemail.module
@@ -425,12 +425,6 @@ function mimemail_mailengine($op, $message = array()) {
 function mimemail_prepare_message($message) {
   module_load_include('inc', 'mimemail');
 
-  $key = $message['key'];
-  $to = $message['to'];
-  $from = $message['from'];
-  $subject = $message['subject'];
-  $body = $message['body'];
-
   $headers = isset($message['params']['headers']) ? $message['params']['headers'] : array();
   $plain = isset($message['params']['plain']) ? $message['params']['plain'] : NULL;
   $plaintext = isset($message['params']['plaintext']) ? $message['params']['plaintext'] : NULL;
@@ -440,7 +434,7 @@ function mimemail_prepare_message($message) {
   $site_mail = variable_get('site_mail', ini_get('sendmail_from'));
 
   // Override site mails default sender when using default engine.
-  if ((empty($from) || $from == $site_mail)
+  if ((empty($message['from']) || $message['from'] == $site_mail)
       && variable_get('mimemail_engine', 'mimemail') == 'mimemail') {
     $mimemail_name = variable_get('mimemail_name', $site_name);
     $mimemail_mail = variable_get('mimemail_mail', $site_mail);
@@ -451,41 +445,39 @@ function mimemail_prepare_message($message) {
   }
 
   // Body is empty, this is a plaintext message.
-  if (empty($body)) {
+  if (empty($message['body'])) {
     $plain = TRUE;
   }
   // Try to determine recipient's text mail preference.
   elseif (is_null($plain)) {
+    $to = $message['to'];
     if (is_object($to) && isset($to->data['mimemail_textonly'])) {
         $plain = $to->data['mimemail_textonly'];
     }
     elseif (is_string($to) && valid_email_address($to)) {
       if (is_object($account = user_load_by_mail($to)) && isset($account->data['mimemail_textonly'])) {
         $plain = $account->data['mimemail_textonly'];
-        $to = $account; // Might as well pass the user object to the address function.
+        $message['to'] = $account; // Might as well pass the user object to the address function.
       }
     }
   }
 
-  $subject = str_replace("\n", '', trim(drupal_html_to_text($subject)));
-  $key = str_replace('_', '-', $key);
-  $body = theme(array('mimemail_message__' . $key, 'mimemail_message'), array('key' => $key, 'recipient' => $to, 'subject' => $subject, 'body' => $body));
+  $message['subject'] = str_replace("\n", '', trim(drupal_html_to_text($message['subject'])));
+  $message['body'] = theme(array('mimemail_message__' . $message['key'], 'mimemail_message'), array('message' => $message));
 
   foreach (module_implements('mail_post_process') as $module) {
     $function = $module . '_mail_post_process';
-    $function($body, $key);
+    $function($message['body'], $message['key']);
   }
 
   $plain = $plain || variable_get('mimemail_textonly', 0);
-  $from = mimemail_address($from);
-  $mail = mimemail_html_body($body, $subject, $plain, $plaintext, $attachments);
+  $mail = mimemail_html_body($message['body'], $message['subject'], $plain, $plaintext, $attachments);
   $headers = array_merge($message['headers'], $headers, $mail['headers']);
 
-  $message['to'] = mimemail_address($to);
-  $message['from'] = $from;
-  $message['subject'] = $subject;
+  $message['headers'] = mimemail_headers($headers, $message['from']);
+  $message['to'] = mimemail_address($message['to']);
+  $message['from'] = mimemail_address($message['from']);
   $message['body'] = $mail['body'];
-  $message['headers'] = mimemail_headers($headers, $from);
 
   return $message;
 }
diff --git a/theme/mimemail-message.tpl.php b/theme/mimemail-message.tpl.php
index 109c384..ca2f0d5 100644
--- a/theme/mimemail-message.tpl.php
+++ b/theme/mimemail-message.tpl.php
@@ -9,7 +9,7 @@
  * specific mail.
  *
  * Available variables:
- * - $recipient: The recipient of the message
+ * - $to: The recipient of the message
  * - $subject: The message subject
  * - $body: The message body
  * - $css: Internal style sheets
diff --git a/theme/mimemail.theme.inc b/theme/mimemail.theme.inc
index 15af378..611bffb 100644
--- a/theme/mimemail.theme.inc
+++ b/theme/mimemail.theme.inc
@@ -10,7 +10,7 @@ function mimemail_theme_theme() {
 
   return array(
     'mimemail_message' => array(
-      'variables' => array('key' => NULL, 'recipient' => NULL, 'subject' => NULL, 'body' => NULL),
+      'variables' => array('message' => array()),
       'template' => 'mimemail-message',
       'pattern' => 'mimemail_message__',
       'file' => 'mimemail.theme.inc',
@@ -23,15 +23,12 @@ function mimemail_theme_theme() {
 /**
  * A preprocess function for theme('mimemail_message').
  *
- * The $variables array initially contains the following arguments:
- * - $recipient: The recipient of the message
- * - $key:  The mailkey associated with the message
- * - $subject: The message subject
- * - $body:  The message body
+ * The $variables array initially contains the message array.
  *
  * @see theme/mimemail-message.tpl.php for additional variables.
  */
 function template_preprocess_mimemail_message(&$variables) {
+  $message = $variables['message'];
   $theme = mailsystem_get_mail_theme();
   $themepath = drupal_get_path('theme', $theme);
 
@@ -112,7 +109,10 @@ function template_preprocess_mimemail_message(&$variables) {
   $variables['css'] = $css;
 
    // Process key to be a proper CSS class.
-  $variables['key'] = str_replace('_', '-', $variables['key']);
+  $variables['key'] = str_replace('_', '-', $message['key']);
+  $variables['to'] = $message['to'];
+  $variables['subject'] = $message['subject'];
+  $variables['body'] = $message['body'];
 }
 
 /**
