acs_mail_lite::utils::build_body (private)

 acs_mail_lite::utils::build_body [ -mime_type mime_type ] \
    [ -charset charset ] body

Defined in packages/acs-mail-lite/tcl/utils-procs.tcl

Encode the body using quoted-printable and build the alternative part if necessary Return a list of message tokens

Switches:
-mime_type
(defaults to "text/plain") (optional)
-charset
(defaults to "UTF-8") (optional)
Parameters:
body

Partial Call Graph (max 5 caller/called nodes):
%3 acs_mail_lite::send_immediately acs_mail_lite::send_immediately (private) acs_mail_lite::utils::build_body acs_mail_lite::utils::build_body acs_mail_lite::send_immediately->acs_mail_lite::utils::build_body ad_html_to_text ad_html_to_text (public) acs_mail_lite::utils::build_body->ad_html_to_text mime::initialize mime::initialize acs_mail_lite::utils::build_body->mime::initialize

Testcases:
No testcase defined.
Source code:

    # Encode the body
    set encoding [ns_encodingforcharset $charset]
    set body [encoding convertto $encoding $body]

    if { $mime_type eq "text/plain" } {
        # Set the message token
        set message_token [mime::initialize  -canonical "$mime_type"  -param [list charset $charset]  -encoding "quoted-printable"  -string "$body"]
    } else {
        set message_html_part [mime::initialize  -canonical "text/html"  -param [list charset $charset]  -encoding "quoted-printable"  -string "$body"]
        set message_text_part [mime::initialize  -canonical "text/plain"  -param [list charset $charset]  -encoding "quoted-printable"  -string [ad_html_to_text -- $body]]

        set message_token [mime::initialize  -canonical "multipart/alternative"  -parts [list $message_text_part $message_html_part]]
    }

    return [list $message_token]
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: