acs_mail_lite::smtp (private)

 acs_mail_lite::smtp -multi_token multi_token -headers headers \
    -originator originator -delivery_dict delivery_dict

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

Send messages via SMTP

Switches:
-multi_token (required)
Multi Token generated which is passed directly to smtp::sendmessage
-headers (required)
List of list of header key-value pairs like {{from malte@cognovis.de} {to malte@cognovis.de}}
-originator (required)
-delivery_dict (required)
dictionary of delivery parameters including the SMTP* configuration parameters

Partial Call Graph (max 5 caller/called nodes):
%3 acs_mail_lite::send_immediately acs_mail_lite::send_immediately (private) acs_mail_lite::smtp acs_mail_lite::smtp acs_mail_lite::send_immediately->acs_mail_lite::smtp

Testcases:
No testcase defined.
Source code:

        # Consider adding code here to
        # set orignator to acs-mail-lite parameter FixedSenderEmail
        # if FixedSenderEmail is not empty,
        # so as to be consistent for all cases calling this proc.

        ns_log notice "SMTP call sendmessage <$originator>"
        set cmd [list smtp::sendmessage $multi_token -originator $originator]
        ns_log notice "SMTP call sendmessage <$originator> DONE"
        foreach header $headers {
            lappend cmd -header $header
        }
        lappend cmd  -servers [dict get $delivery_dict SMTPHost]  -ports [dict get $delivery_dict SMTPPort]

        #
        # Request authentication only, when user AND password are
        # specified. If only one of these is specified, issue a
        # warning and ignore the parameter.
        #
        set smtpUser [dict get $delivery_dict SMTPUser]
        set smtpPassword [dict get $delivery_dict SMTPPassword]
        if {$smtpUser ne "" && $smtpPassword ne "" } {
            lappend cmd -username $smtpUser -password $smtpPassword
        } elseif {$smtpUser ne ""|| $smtpPassword ne ""} {
            ns_log warning "acs-mail-lite::smtp: invalid parameter combination; when SMTPUser is specified, SMTPPassword has to be provided as well and vice versa"
        }
        ns_log notice "SMTP call <$cmd>"

        ns_log Debug "send cmd: $cmd"
        if {[catch $cmd errorMsg]} {
            ns_log Error "acs-mail-lite::smtp: error $errorMsg while executing\n$cmd"
            error $errorMsg
        }
Generic XQL file:
packages/acs-mail-lite/tcl/acs-mail-lite-procs.xql

PostgreSQL XQL file:
packages/acs-mail-lite/tcl/acs-mail-lite-procs-postgresql.xql

Oracle XQL file:
packages/acs-mail-lite/tcl/acs-mail-lite-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: