diff --git a/variable_email.rules.inc b/variable_email.rules.inc
index 80d483e..8f5ca77 100644
--- a/variable_email.rules.inc
+++ b/variable_email.rules.inc
@@ -81,7 +81,7 @@ function variable_email_action_mail($to, $variable, $language = 'default', $from
     $subject = variable_get_value($subject_variable_name);
     $message = variable_get_value($body_variable_name);
   }
-  
+
   // If it's an HTML Mail, make sure we are sending the message content and not an array
   if (is_array($message)) {
     if ($message['format'] == 'php_code') {
@@ -93,19 +93,13 @@ function variable_email_action_mail($to, $variable, $language = 'default', $from
       $message = $message['value'];
     }
   }
-  
+
   $to = str_replace(array("\r", "\n"), '', $to);
   $from = !empty($from) ? str_replace(array("\r", "\n"), '', $from) : NULL;
-  
-  if (isset($element->settings['variable:process'])) {
-    $params['subject'] = $element->settings['variable:process']->evaluate($subject, array(), $state);
-    $params['message'] = $element->settings['variable:process']->evaluate($message, array(), $state);
-  }
-  else  {
-    $params['subject'] = $subject;
-    $params['message'] = $message;
-  }  
-  
+
+  $params['subject'] = _variable_email_evaluate_token($subject, array(), $state);
+  $params['message'] = _variable_email_evaluate_token($message, array(), $state);
+
   // Set a unique key for this mail using variable name
   $key = str_replace('_[mail_part]', '', $variable);
 
@@ -114,3 +108,43 @@ function variable_email_action_mail($to, $variable, $language = 'default', $from
     watchdog('variable_email', 'Successfully sent email %subject from %from to %recipient.', array('%from' => $from, '%recipient' => $to, '%subject'=> $params['subject']));
   }
 }
+
+/**
+ * Replace the tokens in the text.
+ */
+function _variable_email_evaluate_token($text, $options, RulesState $state) {
+  module_load_include('inc', 'rules', 'modules/system.eval');
+  $var_info = $state->varInfo();
+  $options += array('sanitize' => FALSE);
+  $replacements = array();
+
+  // We also support replacing tokens in a list of textual values.
+  $whole_text = is_array($text) ? implode('', $text) : $text;
+  foreach (token_scan($whole_text) as $var_name => $tokens) {
+    $var_name = str_replace('-', '_', $var_name);
+    if (isset($var_info[$var_name]) && ($token_type = _rules_system_token_map_type($var_info[$var_name]['type']))) {
+      // We have to key $data with the type token uses for the variable.
+      $data = rules_unwrap_data(array($token_type => $state->get($var_name)), array($token_type => $var_info[$var_name]));
+      $replacements += token_generate($token_type, $tokens, $data, $options);
+    }
+    else {
+      $replacements += token_generate($var_name, $tokens, array(), $options);
+    }
+    // Remove tokens if no replacement value is found. As token_replace() does
+    // if 'clear' is set.
+    $replacements += array_fill_keys($tokens, '');
+  }
+
+  // Actually apply the replacements.
+  $tokens = array_keys($replacements);
+  $values = array_values($replacements);
+
+  if (is_array($text)) {
+    foreach ($text as $i => $text_item) {
+      $text[$i] = str_replace($tokens, $values, $text_item);
+    }
+    return $text;
+  }
+
+  return str_replace($tokens, $values, $text);
+}
