? mimemail.inc.patch Index: mimemail.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/mimemail/mimemail.inc,v retrieving revision 1.18.2.3 diff -u -p -r1.18.2.3 mimemail.inc --- mimemail.inc 26 Feb 2007 23:58:44 -0000 1.18.2.3 +++ mimemail.inc 18 Feb 2008 07:21:45 -0000 @@ -187,13 +187,17 @@ function mimemail_extract_files($html) { * * @return an absolute : */ -function _mimemail_file($file = NULL, $type = '', $disposition = 'related') { +function _mimemail_file($file = NULL, $name = '', $type = '', $disposition = 'related') { static $files = array(); if ($file && !preg_match('@://|mailto:@', $file) && file_exists($file)) { $content_id = md5($file) .'@'. $_SERVER['HTTP_HOST']; - $new_file = array('name' => substr($file, strrpos($file, '/') + 1), + if (!$name) { + $name = substr($file, strrpos($file, '/') + 1); + } + + $new_file = array('name' => $name, 'file' => $file, 'Content-ID' => $content_id, 'Content-Disposition' => $disposition, @@ -365,7 +369,7 @@ function mimemail_html_body($body, $subj foreach ($attachments as $a) { $a = (object) $a; $content_type = 'multipart/mixed'; - _mimemail_file($a->filepath, $a->filemime, 'attachment'); + _mimemail_file($a->filepath, $a->filename, $a->filemime, 'attachment'); $parts = array_merge($parts, _mimemail_file()); }