diff --git a/includes/mimemail.admin.inc b/includes/mimemail.admin.inc
index 556aa0c..d7ad8b8 100644
--- a/includes/mimemail.admin.inc
+++ b/includes/mimemail.admin.inc
@@ -78,26 +78,6 @@ function mimemail_admin_settings() {
     '#attributes' => array('class' => array('filter-list')),
   );
 
-  // Generate a list of options which theme to use to render the emails.
-  $theme_options = array('current' => t('Current'), 'default' => t('Default'));
-  if (module_exists('domain_theme')) {
-    $theme_options['domain'] = t('Domain');
-  }
-  // Get a list of all themes.
-  $themes = list_themes();
-  foreach ($themes as $name => $theme) {
-    if ($theme->status == 1) {
-      $theme_options[$name] = $theme->info['name'];
-    }
-  }
-  $form['mimemail']['mimemail_theme'] = array(
-    '#type' => 'select',
-    '#title' => t('Theme to render the emails'),
-    '#description' => t('Select the theme that will be used to render the emails. This can be either the current theme, the default theme, the domain theme or any active theme.'),
-    '#options' => $theme_options,
-    '#default_value' => variable_get('mimemail_theme', 'current'),
-  );
-
   $form['mimemail']['advanced'] = array(
     '#type' => 'fieldset',
     '#title' => t('Advanced settings'),
@@ -157,16 +137,5 @@ function mimemail_admin_settings() {
     drupal_set_message(t('Please choose a mail engine.'), 'error');
   }
 
-  $form['#submit'][] = 'mimemail_admin_settings_submit';
-
   return system_settings_form($form);
 }
-
-/**
- * Submit handler for the settings form.
- *
- * Rebuilds theme registry to make changes needed by theme rendering.
- */
-function mimemail_admin_settings_submit($form, &$form_state) {
-  drupal_theme_rebuild();
-}
diff --git a/mimemail.install b/mimemail.install
index 68da95c..ea2b8fe 100644
--- a/mimemail.install
+++ b/mimemail.install
@@ -102,3 +102,13 @@ function mimemail_update_7000() {
     throw new DrupalUpdateException($requirements['mimemail_mailsystem']['description']);
   }
 }
+
+/**
+* Deletes useless variables.
+*/
+function mimemail_update_7001() {
+  variable_del('mimemail_theme');
+}
+
diff --git a/mimemail.module b/mimemail.module
index 0e919f6..9984202 100644
--- a/mimemail.module
+++ b/mimemail.module
@@ -129,14 +129,6 @@ function mimemail_theme() {
 }
 
 /**
- * Implements hook_theme_registry_alter().
- */
-function mimemail_theme_registry_alter(&$theme_registry) {
-  module_load_include('inc', 'mimemail', 'theme/mimemail.theme');
-  return mimemail_theme_theme_registry_alter($theme_registry);
-}
-
-/**
  * Implements hook_rules_file_info().
  */
 function mimemail_rules_file_info() {
diff --git a/theme/mimemail.theme.inc b/theme/mimemail.theme.inc
index 9742123..15af378 100644
--- a/theme/mimemail.theme.inc
+++ b/theme/mimemail.theme.inc
@@ -14,69 +14,13 @@ function mimemail_theme_theme() {
       'template' => 'mimemail-message',
       'pattern' => 'mimemail_message__',
       'file' => 'mimemail.theme.inc',
+      'mail theme' => TRUE,
       'path' => $path,
     )
   );
 }
 
 /**
- * Implements hook_theme_registry_alter().
- */
-function mimemail_theme_theme_registry_alter(&$theme_registry) {
-  global $theme_key;
-  static $executed = array();
-
-  // Preventing double execution.
-  if (isset($executed[$theme_key])) {
-    return;
-  }
-
-  $executed[$theme_key] = TRUE;
-  foreach ($theme_registry as $name => $hook) {
-    if ($name == 'mimemail_message') {
-      $mimemail_theme = _mimemail_get_theme();
-
-      // We don't have to change anything in case the render theme is the current theme.
-      if ($mimemail_theme != $theme_key) {
-        $themes = list_themes();
-        // Getting the render theme.
-        $theme = isset($themes[$mimemail_theme]) ? clone $themes[$mimemail_theme] : NULL;
-        if ($theme != NULL) {
-          // Stablishing variables for further process.
-          $base_theme = array();
-          if (isset($theme->base_themes)) {
-            foreach (array_keys($theme->base_themes) as $base) {
-              $base_theme[$base] = clone $themes[$base];
-            }
-          }
-          if (isset($theme->base_theme) && !isset($base_theme[$theme->base_theme])) {
-            $base_theme[$theme->base_theme] = clone $themes[$theme->base_theme];
-          }
-          $theme_engine = isset($theme->engine) ? $theme->engine : NULL;
-
-          // Include template files to let _theme_load_registry add preprocess functions.
-          include_once(drupal_get_path('theme', $theme->name) . '/template.php');
-          foreach ($base_theme as $base) {
-            include_once(drupal_get_path('theme', $base->name) . '/template.php');
-          }
-
-          // Get the theme_registry cache.
-          $cache = _theme_load_registry($theme, $base_theme, $theme_engine);
-          if (isset($cache[$name])) {
-            $cache[$name]['includes'][] = drupal_get_path('theme', $theme->name) . '/template.php';
-            foreach ($base_theme as $base) {
-              $cache[$name]['includes'][] = drupal_get_path('theme', $base->name) . '/template.php';
-            }
-            // Changing current registry for the new record.
-            $theme_registry[$name] = $cache[$name];
-          }
-        }
-      }
-    }
-  }
-}
-
-/**
  * A preprocess function for theme('mimemail_message').
  *
  * The $variables array initially contains the following arguments:
@@ -88,7 +32,7 @@ function mimemail_theme_theme_registry_alter(&$theme_registry) {
  * @see theme/mimemail-message.tpl.php for additional variables.
  */
 function template_preprocess_mimemail_message(&$variables) {
-  $theme = _mimemail_get_theme();
+  $theme = mailsystem_get_mail_theme();
   $themepath = drupal_get_path('theme', $theme);
 
   $sitestyle = variable_get('mimemail_sitestyle', 1);
@@ -201,35 +145,4 @@ function _mimemail_process_comment($matches) {
       // Single line IE-Mac hack.
       return '/*\_*/';
   }
-}
-
-/**
- * Helper function to retrieve the key of the theme to render the emails.
- *
- * @todo Add some kind of hook to let other modules alter this behavior.
- */
-function _mimemail_get_theme() {
-  global $theme_key;
-
-  $theme = variable_get('mimemail_theme', 'current');
-  switch ($theme) {
-    case 'default':
-      $theme = variable_get('theme_default', NULL);
-      break;
-    case 'current':
-      $theme = $theme_key;
-      break;
-    case 'domain_theme':
-      // Fetch the theme for the current domain.
-      if (module_exists('domain_theme')) {
-        // Assign the selected theme, based on the active domain.
-        global $_domain;
-        $domain_theme = domain_theme_lookup($_domain['domain_id']);
-        // The above returns -1 on failure.
-        $theme = ($domain_theme != -1) ? $domain_theme['theme'] : $theme_key;
-      }
-      break;
-  }
-
-  return $theme;
-}
+}
\ No newline at end of file
