Index: theme/mimemail.theme.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mimemail/theme/mimemail.theme.inc,v
retrieving revision 1.2
diff -u -r1.2 mimemail.theme.inc
--- theme/mimemail.theme.inc	10 Aug 2009 17:53:39 -0000	1.2
+++ theme/mimemail.theme.inc	11 Mar 2010 09:12:35 -0000
@@ -25,22 +25,23 @@
  */
 function template_preprocess_mimemail_message(&$variables) {
   $theme = variable_get('theme_default', NULL);
+  $path_to_theme = drupal_get_path('theme', $theme);
 
   // 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';
+    $styles = $path_to_theme .'/mail.css';
   }
 
   // If no mail.css was found, gather all style sheets
   if (!file_exists($styles)) {
-    // embed a version of all style definitions
-    $styles = preg_replace('|<link.*href="'. base_path()
+    // embed a version of all style definitions from the default theme
+    $styles = preg_replace('|<link.*href="'. $path_to_theme
                            .'([^"?]*)[?"].*|', '\1', drupal_get_css());
   }
 
   // Process each style sheet
   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);
   }
 
   $variables['css'] = str_replace(' ','', str_replace("\n", '', $css));
