RE: Webdatablade output mailed through Perl-Suggest a better mail
Posted in 2000
Please don't post mime - thank you What's the weird error? Why do you want to this via MIEXEC, why not just use a standard perl formhandler with a redirect. You do seem to be making this unduly complicated. Assuming you started with Informix's Serve.pl file as a template why have you removed so much of their code - their version does work. Paul Watson # WF Software Ltd # If in doubt Tel: +44 1436 674729 # make it up Fax: +44 1436 678693 # www.wfsoftware.com # > -----Original Message----- > From: Daniel Haguma [mailto:dhaguma@cucbc.com] > Sent: Friday, October 06, 2000 7:07 PM > To: informix-list@iiug.org > Subject: Webdatablade output mailed through Perl-Suggest a better > mailer? > > > This is a multi-part message in MIME format. > --------------30533895A6C1E1C2D07B5C4C > Content-Type: multipart/alternative; > boundary="------------572A6C6434D4491A24F3D848" > > > --------------572A6C6434D4491A24F3D848 > Content-Type: text/plain; charset=us-ascii > Content-Transfer-Encoding: 7bit > > This is supposed to grab some input from a webpage: > > <?MIVAR NAME=SRVC>cd <perlrlcodedirectory> ;/usr/bin/perl > ./smtpmail.pl<?/MIVAR> > > <?MIEXEC SERVICE=$SRVC REQUEST=RAWPERL>"'The following > Registration Has Just Been Submitted By $one:\\n\\n > +s Just Been Submitted By $one:\\n\\n > Name:$one\\n > Job Title:$two\\n > Representing:$three\\n > Mailing Address:$four\\n > Email Address:$five\\n > City:$six\\n > Postal Code:$seven\\n > Phone Number(s) - Business:$eight\\n > Phone Number(s) - Home:$nine\\n > First Name:$ten\\n > \\n > Will Attend As: $eleven\\n > \\n > Will Go To The Following Events On Thursday:\\n > 1. $twelve\\n > 2. $thirteen\\n > 3. $fourteen\\n > 4. $fifteen\\n > \\n > Will Go To The Following Events On Friday:\\n > 1. $sixteen\\n > 2. $seventeen\\n > 3. $eighteen\\n > 4. $nineteen\\n > \\n > Method Of Payment:$twenty\\n > \\n > \\n > \\n ','user@domain.com'"<?/MIEXEC> > > My perl script : > #!/usr/bin/perl > require 5.002; > BEGIN {$ENV{PATH} = '/usr/ucb:/bin'}; > > #Specify Modules > use Socket; > use Carp; > use FileHandle; > use English; > > $text = @ARGV[0]; > $address = @ARGV[1]; > $syscmd = "echo $text | rmail"; > print "$syscmd\\n"; > system ( $syscmd ); > /^RAWPERL/ && do { > $fileName = '/tmp/' . $port . '.tmp'; > $execute .= "\\n"; > undef(%results);# $execute string may create results > $fileHandle = &executeCommand($fileName, > $attributes, $execute); > > while ( <$fileHandle> ) { # # send back results > $bodyResult .= $_; > } > close $fileHandle; > > last SWITCH; > }; > $bodyResult = " REQUEST \\"$_\\" is unkown"; > doesn't seem to mail though- gives me a wierd error. Anyone > out there know of a better method of mailing with <MIEXEC> ? > > Thx. > > > > > > --------------572A6C6434D4491A24F3D848 > Content-Type: text/html; charset=us-ascii > Content-Transfer-Encoding: 7bit > > <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> > <html> > This is supposed to grab some input from a webpage: > <p><font size=-2><?MIVAR NAME=SRVC>cd > <perlrlcodedirectory> ;/usr/bin/perl > ./smtpmail.pl<?/MIVAR></font><font size=-2></font> > <p><font size=-2><?MIEXEC SERVICE=$SRVC > REQUEST=RAWPERL>"'The following > Registration Has Just Been Submitted By $one:\\n\\n</font> > <br><font size=-2>+s Just Been Submitted By $one:\\n\\n</font> > <br><font size=-2>Name:$one\\n</font> > <br><font size=-2>Job Title:$two\\n</font> > <br><font size=-2>Representing:$three\\n</font> > <br><font size=-2>Mailing Address:$four\\n</font> > <br><font size=-2>Email Address:$five\\n</font> > <br><font size=-2>City:$six\\n</font> > <br><font size=-2>Postal Code:$seven\\n</font> > <br><font size=-2>Phone Number(s) - Business:$eight\\n</font> > <br><font size=-2>Phone Number(s) - Home:$nine\\n</font> > <br><font size=-2>First Name:$ten\\n</font> > <br><font size=-2>\\n</font> > <br><font size=-2>Will Attend As: $eleven\\n</font> > <br><font size=-2>\\n</font> > <br><font size=-2>Will Go To The Following Events On > Thursday:\\n</font> > <br><font size=-2>1. $twelve\\n</font> > <br><font size=-2>2. $thirteen\\n</font> > <br><font size=-2>3. $fourteen\\n</font> > <br><font size=-2>4. $fifteen\\n</font> > <br><font size=-2>\\n</font> > <br><font size=-2>Will Go To The Following Events On Friday:\\n</font> > <br><font size=-2>1. $sixteen\\n</font> > <br><font size=-2>2. $seventeen\\n</font> > <br><font size=-2>3. $eighteen\\n</font> > <br><font size=-2>4. $nineteen\\n</font> > <br><font size=-2>\\n</font> > <br><font size=-2>Method Of Payment:$twenty\\n</font> > <br><font size=-2>\\n</font> > <br><font size=-2>\\n</font> > <br><font size=-2>\\n > ','user@domain.com'"<?/MIEXEC></font><font size=-2></font> > <p>My perl script : > <br><font size=-2>#!/usr/bin/perl</font> > <br><font size=-2>require 5.002;</font> > <br><font size=-2>BEGIN {$ENV{PATH} = > '/usr/ucb:/bin'};</font><font size=-2></font> > <p><font size=-2>#Specify Modules</font> > <br><font size=-2>use Socket;</font> > <br><font size=-2>use Carp;</font> > <br><font size=-2>use FileHandle;</font> > <br><font size=-2>use English;</font><font size=-2></font> > <p><font size=-2>$text = > @ARGV[0];</font> > <br><font size=-2>$address = @ARGV[1];</font> > <br><font size=-2>$syscmd = "echo $text | rmail";</font> > <br><font size=-2>print "$syscmd\\n";</font> > <br><font size=-2>system ( $syscmd );</font> > <br><font size=-2> /^RAWPERL/ && > do {</font> > <br><font > size=-2> > $fileName = '/tmp/' . $port . '.tmp';</font> > <br><font > size=-2> > $execute .= "\\n";</font> > <br><font > size=-2> > undef(%results);# $execute string may create results</font> > <br><font > size=-2> > > $fileHandle = &executeCommand($fileName, $attributes, > $execute);</font> > <br><font size=-2> </font> > <br><font > size=-2> > while ( <$fileHandle> ) { # # send back results</font> > <br><font > size=-2> > > $bodyResult .= $_;</font> > <br><font > size=-2> > }</font> > <br><font > size=-2> > close $fileHandle;</font> > <br><font size=-2> </font> > <br><font > size=-2> > last SWITCH;</font> > <br