Index: mimemail.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mimemail/mimemail.module,v
retrieving revision 1.31.2.3
diff -u -p -r1.31.2.3 mimemail.module
--- mimemail.module	14 Apr 2009 23:08:59 -0000	1.31.2.3
+++ mimemail.module	14 Aug 2009 10:38:19 -0000
@@ -139,6 +139,7 @@ function mimemail_prepare($sender, $reci
 }
 
 function mimemail($sender, $recipient, $subject, $body, $plaintext = NULL, $headers = array(), $text = NULL, $attachments = array(), $mailkey = '') {
+  global $language;
 
   $engine = variable_get('mimemail_engine', 'mimemail') .'_mailengine';
 
@@ -146,21 +147,30 @@ function mimemail($sender, $recipient, $
     return FALSE;
   }
 
+  // Bundle up the variables into a structured array for altering.
+  $message = array(
+    'id'       => $mailkey,
+    'to'       => $recipient,
+    'from'     => $sender,
+    'language' => $language,
+    'params'   => array(),
+    'subject'  => $subject,
+    'body'     => $body,
+    'headers'  => $headers,
+  );
+
   // Allow modules implementing hook_mail_alter() to function when all
   // mail is routed through mimemail.
   //  - doesn't support passing all the variables used here (e.g. attachements)
   //  - should also provide a hook_mimemail_alter for full mimemail support
-  foreach (module_implements('mail_alter') as $module) {
-    $function = $module .'_mail_alter';
-    $function($mailkey, $recipient, $subject, $body, $sender, $headers);
-  }
+  drupal_alter('mail', $message);
 
   $engine_prepare = variable_get('mimemail_engine', 'mimemail') .'_prepare';
   if (function_exists($engine_prepare)) {
-    $message = $engine_prepare($sender, $recipient, $subject, $body, $plaintext, $headers, $text, $attachments, $mailkey);
+    $message = $engine_prepare($message['from'], $message['to'], $message['subject'], $message['body'], $plaintext, $message['headers'], $text, $attachments, $message['id']);
   }
   else {
-    $message = mimemail_prepare($sender, $recipient, $subject, $body, $plaintext, $headers, $text, $attachments, $mailkey);
+    $message = mimemail_prepare($message['from'], $message['to'], $message['subject'], $message['body'], $plaintext, $message['headers'], $text, $attachments, $message['id']);
   }
 
   return $engine('send', $message);
Index: theme/mimemail.tpl.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mimemail/theme/mimemail.tpl.php,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 mimemail.tpl.php
--- theme/mimemail.tpl.php	14 Apr 2009 23:09:01 -0000	1.1.2.2
+++ theme/mimemail.tpl.php	14 Aug 2009 10:38:19 -0000
@@ -8,13 +8,7 @@
 <html>
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <?php if ($css): ?>
-    <style type="text/css">
-      <!--
-      <?php print $css ?>
-      -->
-    </style>
-    <?php endif; ?>
+    <?php if (!empty($css)) { print $css; } ?>
   </head>
   <body id="mimemail-body">
     <div id="center">
