Use multipart/alternative for HTML+text emails
authorJamie Cameron <jcameron@webmin.com>
Thu, 26 Mar 2009 18:07:10 +0000 (18:07 +0000)
committerJamie Cameron <jcameron@webmin.com>
Thu, 26 Mar 2009 18:07:10 +0000 (18:07 +0000)
mailboxes/folders-lib.pl
mailboxes/send_mail.cgi

index 69861d3..7662e8f 100644 (file)
@@ -3527,7 +3527,6 @@ if ($ctype =~ /charset="([a-z0-9\-]+)"/i ||
     $ctype =~ /charset=([a-z0-9\-]+)/i) {
        $charset = $1;
        }
-}
 ## Special handling of HTML header charset ($force_charset):
 ## For japanese text(ISO-2022-JP/EUC=JP/SJIS), the HTML output and
 ## text contents ($bodycontents) are already converted to EUC,
index 1eb50a4..5b9a990 100755 (executable)
@@ -110,6 +110,11 @@ if ($in{'body'} =~ /\S/) {
                                             '7bit' ] ],
                            'data' => $plainbody });
                        }
+
+               # Set content type to multipart/alternative, to tell mail
+               # clients about the optional body
+               push(@{$mail->{'headers'}}, [ 'Content-Type',
+                                             'multipart/alternative' ]);
                }
        }
 $attachsize = 0;