--- mimemail.inc.orig 2009-02-23 21:41:19.000000000 +0530
+++ mimemail.inc 2009-11-06 00:46:03.000000000 +0530
@@ -292,25 +292,27 @@ function mimemail_html_body($body, $subj
));
}
}
- $content_type = 'multipart/alternative';
+ // Include HTML versions of content only if plaintext is not explicitly set
+ else {
+ $content_type = 'multipart/alternative';
- $text_part = array('Content-Type' => 'text/plain; charset=utf-8', 'content' => $text);
+ $text_part = array('Content-Type' => 'text/plain; charset=utf-8', 'content' => $text);
- //expand all local links
- $pattern = '/(]+href=")([^"]*)/emi';
- $body = preg_replace($pattern, '"\\1"._mimemail_url("\2")', $body);
+ //expand all local links
+ $pattern = '/(]+href=")([^"]*)/emi';
+ $body = preg_replace($pattern, '"\\1"._mimemail_url("\2")', $body);
- $mime_parts = mimemail_extract_files($body);
+ $mime_parts = mimemail_extract_files($body);
- $content = array($text_part, array_shift($mime_parts));
- $content = mimemail_multipart_body($content, $content_type, TRUE);
- $parts = array(array('Content-Type' => $content['headers']['Content-Type'], 'content' => $content['body']));
-
- if ($mime_parts) {
- $content_type = 'multipart/related';
- $parts = array_merge($parts, $mime_parts);
- }
+ $content = array($text_part, array_shift($mime_parts));
+ $content = mimemail_multipart_body($content, $content_type, TRUE);
+ $parts = array(array('Content-Type' => $content['headers']['Content-Type'], 'content' => $content['body']));
+ if ($mime_parts) {
+ $content_type = 'multipart/related';
+ $parts = array_merge($parts, $mime_parts);
+ }
+ }
foreach ($attachments as $a) {
$a = (object) $a;
$content_type = 'multipart/mixed';