on 6/20/01 2:26 AM, [EMAIL PROTECTED] at
[EMAIL PROTECTED] wrote:
>> I don't exactly understand what you're doing, but this is definitely an
>> error.
Well, it pretty simple first the script tries to send an email, then second
the script replies to the browser the mail was sent. for now the body of the
email is supplied in the script itself, later of course that will be
comprised of the data from the form submission, once I get it working.
>> By outputting the length of buffer, and then changing
>> buffer, the
>> outputted length ain't correct anymore.
Yes, obviously, thanks for pointing that out...oddly enough it still worked.
>> So, first manipulate buffer as you want, and then output the
>> whole thing. So
>> your script would be like:
>>
>> put it after buffer
>> put cr & cr & "Your Mail was sent" after buffer
>>
>> # and then, at last:
>> put "Content-Type: text/plain" & cr
>> put "Content-Length:" && the length of buffer & cr & cr
>> put buffer
OK I fixed that and since have also now access to the cgi error log..
When I run the script below. I get this:
>///org/g/our account/www/public_html/cgi-bin/mail_using_mc.cgi
>[Sun Jun 17 14:25:02 2001] [error] [client 207.12.0.10] Premature end of
>script headers:
Again the problem is: no mail is sent. The second "phase" sending the notice
back to the browser does work. So I am assuming the error message must refer
to a problem in "phase 1" where we try to open the mail process and write to
it. Anyone have any clues?
#!/export/vhost/org/g/gurudeva/www/public_html/cgi-bin/mc
on startup
## first we try to send a memo
put "/usr/lib/sendmail" into mprocess
open process mprocess for write
write "From:" && "[EMAIL PROTECTED]" & cr to process mprocess
write "To:" && "[EMAIL PROTECTED]" & cr to process mprocess
write "Subject:" && "test MC mail from HOL" & cr & cr to process mprocess
write "Sadhunathan, if you get this mail let me know by forwarding a copy
to me--it was sent using a CGI at TAKA called mail_using_mc.cgi" to process
mprocess
close process mprocess
wait until the openprocesses is empty
## now we simply inform the browser that it was sent (but problem is
## it is not being sent.
read from stdin until empty
put it after buffer
put cr & cr & "Your Mail was sent" after buffer
put "Content-Type: text/plain" & cr
put "Content-Length:" && the length of buffer & cr & cr
put buffer
end startup
??
Hinduism Today
Sivakatirswami
Editor's Assistant/Production Manager
[EMAIL PROTECTED]
www.HinduismToday.com, www.HimalayanAcademy.com,
www.Gurudeva.org, www.hindu.org
Archives: http://www.mail-archive.com/[email protected]/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.