Index: mimemail.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mimemail/mimemail.inc,v
retrieving revision 1.29
diff -u -p -r1.29 mimemail.inc
--- mimemail.inc	8 Aug 2008 04:24:18 -0000	1.29
+++ mimemail.inc	10 Aug 2008 22:00:10 -0000
@@ -486,24 +486,24 @@ function _mimemail_uri($href, $link) {
  * @return an absolute url, sans mailto:
  */
 function _mimemail_url($url) {
+  $url = str_replace(" ", "%20", $url);
+
   if (strpos($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()) + 1); // find the host by taking $base_url and tearing off base_path().
+
+  return $host . $url;
 }
 
 /**
