diff -ru ../mimemail/mimemail.inc ./mimemail.inc
--- ../mimemail/mimemail.inc	2010-11-06 11:15:50.000000000 -0700
+++ ./mimemail.inc	2011-01-22 12:57:34.000000000 -0800
@@ -109,10 +109,11 @@
  * Helper function to extract local files
  *
  * @param $url a URL to a file
+ * @param $content Actual file contents (only used if $url is NULL)
  *
  * @return an absolute :
  */
-function _mimemail_file($url = NULL, $name = '', $type = '', $disposition = 'related') {
+function _mimemail_file($url = NULL, $content = NULL, $name = '', $type = '', $disposition = 'related') {
   static $files = array();
   static $filenames = array();
 
@@ -162,6 +163,31 @@
   elseif ($url) {
     return $url;
   }
+  // There is no $url, so maybe we have some content
+  elseif ($content) { 
+    if (empty($name)) {
+      $name = 'attachment.dat';
+    }
+
+    if (empty($type)) {
+      $type = file_get_mimetype($name);
+    }
+
+    $content_id = md5($content) .'@'. $_SERVER['HTTP_HOST'];
+
+    $new_file = array(
+      'name' => $name,
+      'content' => chunk_split(base64_encode($content)),
+      'Content-Transfer-Encoding' => 'base64',
+      'Content-Disposition' => $disposition,
+      'Content-Type' => $type,
+    );
+
+    $files[] = $new_file;
+    $filenames[$file] = $content_id;
+
+    return 'cid:'. $content_id;
+  }
 
   $ret = $files;
   $files = array();
@@ -346,7 +372,7 @@
     $a = (object) $a;
     // Check the list parameter if its set or ignore it (Upload module support).
     if(!isset($a->list) || $a->list) {
-      _mimemail_file($a->filepath, $a->filename, $a->filemime, 'attachment');
+      _mimemail_file($a->filepath, $a->contents, $a->filename, $a->filemime, 'attachment');
       $parts = array_merge($parts, _mimemail_file());
     }
   }
