Index: theme/mimemail.theme.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mimemail/theme/mimemail.theme.inc,v
retrieving revision 1.5
diff -u -r1.5 mimemail.theme.inc
--- theme/mimemail.theme.inc	21 Apr 2010 23:26:42 -0000	1.5
+++ theme/mimemail.theme.inc	12 Aug 2010 09:04:10 -0000
@@ -25,22 +25,25 @@
  */
 function template_preprocess_mimemail_message(&$variables) {
   $theme = variable_get('theme_default', NULL);
+  $mailstyle = drupal_get_path('theme', $theme) .'/mail.css';
 
   // Check for the existence of a mail.css file in the current theme folder
-  if (!file_exists($styles)) {
-    $styles = drupal_get_path('theme', $theme) .'/mail.css';
+  if (@file_exists($mailstyle)) {
+    $styles = $mailstyle;
   }
-
   // If no mail.css was found, gather all style sheets
-  if (!file_exists($styles)) {
-    // embed a version of all style definitions
+  // and embed a version of all style definitions
+  else {
     $styles = preg_replace('|<link.*href="'. base_path()
-                           .'([^"?]*)[?"].*|', '\1', drupal_get_css());
+                          .'([^"?]*)[?"].*|', '\1', drupal_get_css());
   }
 
   // Process each style sheet
+  $css = '';
   foreach (explode("\n", $styles) as $style) {
-    if (file_exists($style)) $css .= file_get_contents($style);
+    if (!empty($style) && @file_exists($style)) {
+      $css .= @file_get_contents($style);
+    }
   }
 
   // Perform some safe CSS optimizations. (derived from core CSS aggregation)
