Index: includes/mimemail.admin.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/mimemail/includes/mimemail.admin.inc,v retrieving revision 1.1 diff -u -r1.1 mimemail.admin.inc --- includes/mimemail.admin.inc 22 Feb 2009 20:55:46 -0000 1.1 +++ includes/mimemail.admin.inc 10 Mar 2010 18:39:21 -0000 @@ -25,7 +25,16 @@ db_query("DELETE FROM {variable} WHERE name = 'smtp_library'"); } } - + + // Check for the existence of a mail.css file in the current theme folder + $theme = variable_get('theme_default', NULL); + $mailstyle = drupal_get_path('theme', $theme) .'/mail.css'; + // Disable site style sheets including option if found + if (is_file($mailstyle)) { + variable_set('mimemail_sitestyle', FALSE); + $disable_sitestyle = TRUE; + } + $engines = mimemail_get_engines(); $form = array(); @@ -40,8 +49,17 @@ $form['mimemail']['mimemail_alter'] = array( '#type' => 'checkbox', '#title' => t('Use mime mail for all messages'), - '#default_value' => variable_get('mimemail_alter', 0), - '#description' => t('Use the mime mail module to deliver all site messages. With this option, system emails will have styles and formatting'), + '#default_value' => TRUE, + '#description' => t('Use the mime mail module to deliver all site messages. With this option, system emails will have styles and formatting') + ); + + // Optional including of site style sheets + $form['mimemail']['mimemail_sitestyle'] = array( + '#type' => 'checkbox', + '#title' => t('Include site style sheets'), + '#default_value' => variable_get('mimemail_sitestyle', 0), + '#description' => t('Gathers all style sheets when no mail.css is defined in the theme directory.'), + '#disabled' => $disable_sitestyle, ); $filter_format = variable_get('mimemail_format', FILTER_FORMAT_DEFAULT); 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 10 Mar 2010 18:39:21 -0000 @@ -30,9 +30,13 @@ if (!file_exists($styles)) { $styles = drupal_get_path('theme', $theme) .'/mail.css'; } + + // Check if site style sheets including is enabled + $sitestyle = variable_get('mimemail_sitestyle', 0); - // If no mail.css was found, gather all style sheets - if (!file_exists($styles)) { + // Gather all style sheets if no mail.css was found + // and the site style sheets including is enabled + if (!file_exists($styles) && $sitestyle) { // embed a version of all style definitions $styles = preg_replace('|