Index: theme/mimemail.theme.inc
===================================================================
RCS file: /cvs/drupal/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	14 Mar 2010 13:27:06 -0000
@@ -24,23 +24,25 @@
  * See includes/mimemail.tpl.php for additional variables
  */
 function template_preprocess_mimemail_message(&$variables) {
-  $theme = variable_get('theme_default', NULL);
+  $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
+  else {
+    // embed a version of all style definitions from the default theme
     $styles = preg_replace('|<link.*href="'. base_path()
                            .'([^"?]*)[?"].*|', '\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));
