Index: mimemail.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mimemail/mimemail.inc,v
retrieving revision 1.28
diff -u -p -r1.28 mimemail.inc
--- mimemail.inc	7 Aug 2008 23:33:35 -0000	1.28
+++ mimemail.inc	8 Aug 2008 00:21:54 -0000
@@ -480,20 +480,18 @@ function _mimemail_url($url) {
     return $url;
   }
 
-  if (preg_match('!mailto:!i', $url)) {
+  if (preg_match('!^mailto:!i', $url)) {
     return $url;
   }
 
-  $url = preg_replace( '!'. base_path() .'!', '', $url, 1);
-  $url = str_replace('?q=', '', $url);
-  list($url, $fragment) = explode('#', $url, 2);
-  list($path, $query) = explode('?', $url, 2);
-
-  if (empty($path) && !empty($fragment)) {
-    return '#'. $fragment;
+  if ($url[0] != '/') { // if its not relative to the site's domain
+    return $url; // we can't handle it properly
   }
 
-  return url($path, $query, $fragment, TRUE);
+  global $base_url;
+  $host = substr($base_url .'/', 0, strlen($base_url) - strlen(base_path())); // find the host by taking $base_url and tearing off base_path().
+
+  return $host . $url;
 }
 
 /**
