I got a .mt snippet from Scott to try to pipe a memo out to the mail on a
Sun Sparc Solaris put it together like this...but it doesn't work... no mail
is sent. I do get the feed back in the browser so the script doesn't lock up
or anything, but no mail is sent.:
#!/path/vhost/username/www/public_html/cgi-bin/mc --fictitious path
on startup
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
read from stdin until empty
put it after buffer
put "Content-Type: text/plain" & cr
put "Content-Length:" && the length of buffer & cr & cr
put cr & cr & "Your Mail was sent" after buffer
put buffer
end startup
Now, we are sending mail from PERL scripts that are running in the same
cgi-bin ( difference being the mc interpreter is executing the scripts from
right within own cgi-bin, while the PERL interpreter is run from
#!/usr/local/bin/perl
Any clues as to the mc script doesn't work?
The PERL code that does the mail thing looks like this (minus a lot of extra
stuff)
$mailprog = '/usr/lib/sendmail';
-- then later after processing the form data
# Send E-Mail a subroutine
&send_mail;
sub send_mail {
# Open The Mail Program
open(MAIL,"|$mailprog -t");
print MAIL "To: $Config{'recipient'}\n";
print MAIL "From: $Config{'email'} ($Config{'realname'})\n";
print MAIL "Subject: $Config{'subject'}\n\n" }
-- next the PERL script passes all the form data to the mailprog with
consecutive print commands. I have snipped all those...the comprise the body
of the memo....
print MAIL "Below is the result of your feedback form. It was submitted
by:\n";
}
close (MAIL);
}
Getting a .mt script send mail is my last basic hurdle for switching
entirely from PERL to MC. Probably something very simple.
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.