Index: openacs-4/packages/acs-tcl/tcl/html-email-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/html-email-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-tcl/tcl/html-email-procs.tcl 24 Jul 2004 08:34:07 -0000 1.6 +++ openacs-4/packages/acs-tcl/tcl/html-email-procs.tcl 14 Feb 2005 21:08:06 -0000 1.7 @@ -120,13 +120,29 @@ set parts [list $mime] } + # Expand any first-level multipart/alternative children. + set expanded_parts [list] foreach part $parts { + if { [string equal [mime::getproperty $part content] "multipart/alternative" ] } { + foreach child_part [mime::getproperty $part parts] { + lappend expanded_parts $child_part + } + } else { + lappend expanded_parts $part + } + } + + foreach part $expanded_parts { switch [mime::getproperty $part content] { "text/plain" { - set plain [mime::getbody $part] + if { ![info exists plain] } { + set plain [mime::getbody $part] + } } "text/html" { - set html [mime::getbody $part] + if { ![info exists html] } { + set html [mime::getbody $part] + } } } }