Remove commented out SQL with explicit Tcl variables in it. Thevariables ended up uncommented in the resulting query, causing asynxtax error. The rest of the SQL that was not commented works fine.
Fix build_mime_message to package require mime since we don't includethe mime procedures in opeancs anymore, tcllib is required to beinstalled and available to openacs.