Index: openacs-4/packages/acs-mail-lite/tcl/complex-send-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-mail-lite/tcl/Attic/complex-send-procs.tcl,v diff -u -N -r1.16 -r1.17 --- openacs-4/packages/acs-mail-lite/tcl/complex-send-procs.tcl 29 Nov 2007 17:35:01 -0000 1.16 +++ openacs-4/packages/acs-mail-lite/tcl/complex-send-procs.tcl 29 Nov 2007 23:18:57 -0000 1.17 @@ -232,9 +232,6 @@ @param alternative_part_p Boolean whether or not the code generates a multipart/alternative mail (text/html) } { - # Send all emails as text/plain per default - set multi_token_type $mime_type - set mail_package_id [apm_package_id_from_key "acs-mail-lite"] if {$package_id eq ""} { set package_id $mail_package_id @@ -290,14 +287,15 @@ set encoding [ns_encodingforcharset $charset] set body [encoding convertto $encoding $body] + set multi_token_type "" if { $alternative_part_p eq "0"} { # Set the message token set message_token [mime::initialize -canonical "$mime_type" \ -param [list charset $charset] \ -encoding "quoted-printable" \ -string "$body"] } else { - set multi_token_type "multipart/alternative" + set multi_token_type "multipart/alternative" # build multipart/alternative if { $mime_type eq "text/plain" } { @@ -333,7 +331,7 @@ if {[exists_and_not_null file_ids]} { - set multi_token_type "multipart/mixed" + set multi_token_type "multipart/mixed" # Check if we are dealing with revisions or items. foreach file_id $file_ids { set item_id [content::revision::item_id -revision_id $file_id] @@ -355,7 +353,7 @@ # Append files from the filesystem if {$files ne ""} { - set multi_token_type "multipart/mixed" + set multi_token_type "multipart/mixed" foreach file $files { lappend tokens [mime::initialize -param [list name "[ad_quotehtml [lindex $file 0]]"] -canonical [lindex $file 1] -file "[lindex $file 2]"] } @@ -370,16 +368,19 @@ where r.revision_id = i.latest_revision and i.parent_id = :folder_id} { lappend tokens [mime::initialize -param [list name "[ad_quotehtml $title]"] -canonical $mime_type -file "[cr_fs_path]$filename"] lappend item_ids $item_id - set multi_token_type "multipart/mixed" + set multi_token_type "multipart/mixed" } } } #### Now we start with composing the mail message #### + if { $multi_token_type eq "multipart/mixed" } { + set multi_token [mime::initialize -canonical $multi_token_type -parts "$tokens"] + } else { + set multi_token $tokens + } - set multi_token [mime::initialize -canonical $multi_token_type -parts "$tokens"] - # Set the message_id set message_id "[mime::uniqueID]" mime::setheader $multi_token "message-id" "[mime::uniqueID]"