Hi
I'm trying to send a plain text email using acs-mail-lite. I've followed the recommendations in Jades thread https://openacs.org/forums/message-view?message_id=191961 but I keep running into an error.
I have cut my code down to a bare example .tcl page to illustrate the problem:
========================================================
set user_id [ad_conn user_id]
set package_id [ad_conn package_id]
set to_addr [db_string get_user_addr {select email from parties where party_id=:user_id}]
set from_addr [ad_system_owner]
set subject "ACS Mail-Lite Test"
set body "ACS Mail-Lite Test [clock format [clock seconds] -format "%x"]\n\nThis is a test mail from acs-mail-lite"
set header [ns_set new]
ns_set put $header "Content-Type" text/plain
acs_mail_lite::send \
-to_addr $to_addr \
-from_addr $from_addr \
-subject $subject \
-body $body \
-extraheaders $header \
-package_id $package_id
ns_return 200 "text/plain" "Mail Sent [clock format [clock seconds] -format "%x"]"
========================================================
This works fine and returns the Mail Sent text. When I look in the acs_mail_lite_queue table the message is waitin but everytime the sweeper runs I get the following error because the extraheaders column is not an ns_set.
[13/Jul/2004:21:59:13][16785.1101179824][-sched:13-] Error: no such set: Content-Type text/plain Message-Id <-1183370610.1089752278.oacs@steve.festinalente.co.uk>
no such set: Content-Type text/plain Message-Id <-1183370610.1089752278.oacs@steve.festinalente.co.uk>
while executing
"ns_set size $extraheaders"
(procedure "_ns_sendmail" line 11)
invoked from within
"_ns_sendmail $smtp $smtpport $timeout $tolist $bcclist $from $subject $body $extraheaders"
(procedure "ns_sendmail" line 47)
I'm running oacs 5.10 with acs-mail-lite 1.0b2 straight out of the repository.
Any help gratefully received.
Steve