diff --git README.txt README.txt
index 906883a..545a2f2 100644
--- README.txt
+++ README.txt
@@ -21,7 +21,12 @@ To submit bug reports and feature suggestions, or to track changes:
 Installation
 ------------
 
-Install as usual, see http://drupal.org/node/70151 for further information.
+To include inline styles so that your site theme is applied to your html emails,
+download Emogrifier from http://www.pelagodesign.com/sidecar/emogrifier/
+and move the emogrifier.php file to
+DRUPAL_ROOT/sites/all/libraries/emogrifier/emogrifier.php
+
+Install as usual; see http://drupal.org/node/895232 for further information.
 
 
 Theming
@@ -36,9 +41,9 @@ folder to your current theme's folder.
 admin-> settings -> performance
 [Clear Cached Data]
 
-Template suggestions per module allow seperate templates which effect the emails coming from the
+Template suggestions per module allow separate templates which affect the emails coming from the
 particular module. For user module:
-eg. htmlmail-user.tpl.php
+(e.g.) htmlmail-user.tpl.php
 
 Creating the above file will override email theming template for email coming from the user module.
 You may place the template in your theme's directory but remember that a copy of
@@ -54,8 +59,8 @@ For tips and resources on building HTML e-mails see:
 Important
 ---------
 
-Remember that many email clients will not be happy with certain code, your 
-CSS may conflict with a web-mail providers CSS and HTML in email may expose 
+Remember that many email clients will not be happy with certain code.  Your 
+CSS may conflict with a web-mail provider's CSS, and HTML in email may expose 
 security hazards. Beyond this, if your still really, really must have HTML in 
 your email, you may find this module useful.
 
diff --git htmlmail.admin.inc htmlmail.admin.inc
index 67a30f3..0271b20 100644
--- htmlmail.admin.inc
+++ htmlmail.admin.inc
@@ -19,6 +19,12 @@ function htmlmail_admin_settings() {
     '#default_value' => variable_get('htmlmail_urlfilter', '1'),
     '#description' => t('Turns web and e-mail addresses into clickable links. URLs longer than 72 characters will be truncated.'),
   );
+  $form['htmlmail_sitecss'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Use site CSS'),
+    '#default_value' => variable_get('htmlmail_sitecss', '0'),
+    '#description' => t('Add default theme stylesheets so that content sent by email is styled the same way as content on the website.'),
+  );
   $form['htmlmail_emogrifier'] = array(
     '#type' => 'checkbox',
     '#title' => t('Emogrifier'),
@@ -26,6 +32,13 @@ function htmlmail_admin_settings() {
     '#description' => t('Insert your CSS definitions as inline styles into HTML tags for Outlook 2007 and Google Gmail.<br /><em>Checkbox will be disabled if DOM extension is not loaded.</em>'),
     '#disabled' => !extension_loaded('dom'),
   );
+  $form['htmlmail_transliteration'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Transliteration'),
+    '#default_value' => variable_get('htmlmail_transliteration', '0'),
+    '#description' => t('Convert non-latin text to US-ASCII equivalents.<br /><em>Checkbox will be disabled if transliteration module is not enabled.</em>'),
+    '#disabled' => !module_exists('transliteration'),
+  );
   $form['htmlmail_debug'] = array(
     '#type' => 'checkbox',
     '#title' => t('Debug'),
diff --git htmlmail.info htmlmail.info
index 1a686b4..d3400eb 100644
--- htmlmail.info
+++ htmlmail.info
@@ -1,6 +1,7 @@
 ; $Id$
 name = HTML Mail
 description = "Enable HTML in system emails"
+dependencies[] = libraries
 files[] = htmlmail.module
 files[] = htmlmail.admin.inc
 files[] = htmlmail.install
diff --git htmlmail.mail.inc htmlmail.mail.inc
index 236f520..2fad6ed 100644
--- htmlmail.mail.inc
+++ htmlmail.mail.inc
@@ -41,6 +41,12 @@ class HTMLMailMailSystem implements MailSystemInterface {
       $mimeheaders[] = $name . ': ' . mime_header_encode($value);
     }
     $line_endings = variable_get('mail_line_endings', MAIL_LINE_ENDINGS);
+    $extra = '';
+    if (isset($message['headers']['Return-Path']) &&
+	!ini_get('safe_mode') &&
+	!strpos(ini_get('sendmail_path'), ' -f')) {
+      $extra = '-f ' . $message['headers']['Return-Path'];
+    }
     return mail(
       $message['to'],
       mime_header_encode($message['subject']),
@@ -51,7 +57,8 @@ class HTMLMailMailSystem implements MailSystemInterface {
       preg_replace('@\r?\n@', $line_endings, $message['body']),
       // For headers, PHP's API suggests that we use CRLF normally,
       // but some MTAs incorrectly replace LF with CRLF. See #234403.
-      join("\n", $mimeheaders)
+      join("\n", $mimeheaders),
+      $extra
     );
   }
 }
diff --git htmlmail.module htmlmail.module
index e342276..e49d7ac 100644
--- htmlmail.module
+++ htmlmail.module
@@ -101,6 +101,12 @@ function htmlmail_mail_alter(&$message) {
       $message['body'] = _htmlmail_emogrify($message);
     }
 
+    // Use transliteration to to ensure consistent display on mobile devices.
+    if (variable_get('html_transliteration', '0') &&
+	function_exists('transliteration_get')) {
+	$message['body'] = transliteration_get($message['body']);
+    }
+
     // Send the module name in email for theme template suggestions
     if (variable_get('htmlmail_debug', '0')) {
       $message['body'] .= '<p>Debug: module = ' . $message['module'] . '</p>';
@@ -122,6 +128,44 @@ function htmlmail_theme() {
 }
 
 /**
+ * This function works like drupal_get_css() except that it returns css file
+ * contents rather than links, for compatibility with emogrifier.
+ */
+
+function _htmlmail_get_css() {
+  $output = '';
+  // @todo Perhaps is is possible to use a callback function together with
+  // hook_element_info() or hook_element_info_alter() to make drupal_render()
+  // work for us and avoid the following cut-and-paste from drupal_get_css().
+  $css = drupal_add_css();
+  drupal_alter('css',$css);
+  uasort($css, 'drupal_sort_css_js');
+  $previous_item = array();
+  foreach ($css as $key => $item) {
+    if ($item['type'] == 'file') {
+      $basename = isset($item['basename']) ? $item['basename'] : basename($item['data']);
+      if (isset($previous_item[$basename])) {
+        unset($css[$previous_item[$basename]]);
+      }
+      $previous_item[$basename] = $key;
+    }
+  }
+  // End of cut-and-paste from drupal_get_css() code.
+  foreach($css as $item) {
+    switch ($item['type']) {
+      case 'file':
+	$output .= file_get_contents(DRUPAL_ROOT . base_path() . $item['data']);
+        break;
+      case 'inline':
+	$output .= $item['data'];
+        break;
+      default:
+    }
+  }
+  return $output;
+}
+
+/**
  * Process variables to format e-mail.
  *
  * @see htmlmail.tpl.php
@@ -130,7 +174,13 @@ function template_preprocess_htmlmail(&$variables) {
   $variables['path'] = url($variables['directory'], array('absolute' => TRUE));
   $variables['header'] = variable_get('htmlmail_header', '');
   $variables['footer'] = variable_get('htmlmail_footer', '');
-  $variables['css'] = variable_get('htmlmail_css', '');
+  $variables['css'] = '';
+  // Start with standard theme css.
+  if (variable_get('htmlmail_sitecss', '0')) {
+    $variables['css'] .= _htmlmail_get_css();
+  }
+  // Later rules override earlier ones.
+  $variables['css'] .= variable_get('htmlmail_css', '');
   $variables['template_files'][] = 'htmlmail-' . $variables['module'];
 }
 
@@ -170,12 +220,14 @@ function htmlmail_mail($key, &$message, $params) {
  *           The modified message body string with inlined CSS applied.
  */
 function _htmlmail_emogrify(&$message) {
-  $path = drupal_get_path('module', 'htmlmail') . '/emogrifier/emogrifier.php';
+  $path = libraries_get_path('emogrifier') . '/emogrifier.php';
   if (is_file($path)) {
     $style = array();
     // Pull out the contents of any style tags
     if (preg_match_all("@<style[^>]*>(.*)</style>@Usi", $message['body'], $matches, PREG_PATTERN_ORDER)) {
       $style = $matches[1];
+      // Remove the (now redundant) rules to reduce overall filesize.
+      $message['body'] = str_replace($matches[0],'',$message['body']);
     }
     // Emogrify can't handle several CSS rules on one line. As a precaution,
     // we therefore insert LF after each closing bracket.
diff --git htmlmail.tpl.php htmlmail.tpl.php
index 52e0147..d7d102e 100644
--- htmlmail.tpl.php
+++ htmlmail.tpl.php
@@ -34,7 +34,9 @@
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 <?php if ($css): ?>
 <style type="text/css">
+<!-- 
 <?php print $css; ?>
+ -->
 </style>
 <?php endif; ?>
 </head>
