in reply to Calling Perl from HTML
#!/usr/bin/perl -w use strict; my $sendmail = "/usr/sbin/sendmail -t"; my $recipient = "schafferm\@ameritech.net"; open(SENDMAIL, "|$sendmail $recipient") or die "Cannot pipe to $sendma +il: $!"; print SENDMAIL <<"END_MAIL"; From: Foo\@Bar.com Subject: Request to share information To: user\@ameritech.net Hello... END_MAIL close(SENDMAIL); print "Content-type: text/plain\n\nMail sent.";
Don't forget something like the last line. The webserver expects the script to produce a valid HTTP reply.
In reply to grag: no, just didn't think of it :-)Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Calling Perl from HTML
by graq (Curate) on Jul 17, 2002 at 13:14 UTC | |
by OEMike (Novice) on Jul 17, 2002 at 14:33 UTC |