Hi,
Im a newbie to OpenACS and Roberto Mello has kindly helped me a
little with my problem, however im still getting a file-not-
found.html error when i try run this. Forgive me for the long post
with the code but its best if i show the whole picture.
Ive got compose.tcl/adp files which is a form to take the params for
sending an email and ive got ending.tcl/adp files which are meant to
take the input from the form and send the email via the send_mail
function (from my webmail-procs.tcl file). I can fill in the form but
then when I send it, it goes wrong. I think the problem is to do with
the @...@ for the params as im confused as to where they are meant to
go. And it could be also to do with the form as Im not sure if i
should be using the formtemplate or form and whether im using it
right.
Ok, heres the code - any help would be greatly appreciated and an
explanation would be more than appreciated.
__________________________________________________________________
compose.adp
master src="master-template">
property name="title">@page_title@
html>
head>
style>
h3 { font-family: Arial, Helvetica }
th { font-family: Arial, Helvetica }
td { font-family: Arial, Helvetica }
/style>
/head>
center>
body>
formtemplate id="compose_email" action="@target@">
table>
tr>
td>Sender
td>
/tr>
tr>
td>Recipients
td>
/tr>
tr>
td>Subject
td>
/tr>
tr>
td>Body
td>
/tr>
/table>
center>
input type=submit value="@submit_label@">
/center>
/formtemplate>
/center>
/html>
__________________________________________________________________
compose.tcl
# Create form
form create compose_email
element create compose_email sender -datatype text
-html { size 50 }
-label "Sender"
element create compose_email recipients -datatype text
-html { size 50 }
-label "Recipients"
element create compose_email subject -datatype text
-html { size 50 }
-label "Subject"
element create compose_email body -widget textarea
-datatype text
-html { cols 48 rows 8 wrap soft }
-label "Body"
# Set values
set from "testing@hotmail.com"
set to "mo2mo@hotmail.com"
if { [form is_request compose_email] } {
element set_properties compose_email sender -value $from
element set_properties compose_email recipients -value $to
}
set page_title "Composing an email"
set submit_label "Send"
set target "sending"
__________________________________________________________________
sending.tcl
send_mail { @sender@ @recipients@ @subject@ @body@ }
set page_title "Sending email"
__________________________________________________________________
sending.adp
html>
!-- I dont really need anything here do I? -->
Mail sending
/html>
__________________________________________________________________
webmail-procs.tcl
proc send_mail { sender recipients subject body } {
ns_write "Starting the ns_sendmail command...
"
if [catch { ns_sendmail $recipients $sender $subject $body }
errmsg] {
ns_write "Failed sending email to $recipients: $errmsg"
}
ns_write "
Ending the ns_sendmail command...
"
}
__________________________________________________________________
Thank you very much for any help, advice and guidance.
Ayman
PS: How can you display HTML on the bboard if youve selected HTML to
use the pre tag? Any overidding mechanism? I just chopped off
the beginning of each tag - doesnt seem the best way to do it.
Request notifications