CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
Help with finding a replacement for formmailer

 



biggun
Novice

Mar 13, 2002, 4:00 AM

Post #1 of 11 (5095 views)
Help with finding a replacement for formmailer Can't Post

please help me out here all my sites needs is somethign to replaces this, because im running windows xp pro and qmail, which is the program that it uses to send the form doesnt work on win xp.

if you dont understand goto: http://cybertechno.no-ip.com and try to buy something.


i was thing of using this : http://www.web-scripts.co.uk/products/

could someone help me out please?


yapp
User

Mar 13, 2002, 5:32 AM

Post #2 of 11 (5093 views)
Re: [biggun] Help with finding a replacement for formmailer [In reply to] Can't Post

My form mailer uses Net::SMTP in windows. That module does not some compiler stuff, you you can put the file Net/SMTP.pm in your cgi-bin directory. (or put it in an other directory pointed to by a use lib statement).

http://www.codingdomain.com/cgi-perl/downloads/x-mailform/

Yet Another Perl Programmer

_________________________________
~~> [url=http://www.codingdomain.com]www.codingdomain.com <~~
More then 3500 X-Forum [url=http://www.codingdomain.com/cgi-perl/downloads/x-forum]Downloads! Cool

(This post was edited by yapp on Mar 13, 2002, 5:32 AM)


biggun
Novice

Mar 13, 2002, 11:13 AM

Post #3 of 11 (5087 views)
Re: [yapp] Help with finding a replacement for formmailer [In reply to] Can't Post

thanks for getting bk to me, but the link is dead :( could you tell me where to get it from please :)


yapp
User

Mar 14, 2002, 3:23 AM

Post #4 of 11 (5083 views)
Re: [biggun] Help with finding a replacement for formmailer [In reply to] Can't Post

Oh boy! I'll fix that when as soon as possible (i am at school now). Thanks for letting me know. (althrough you can copy-paste the online listing.) At the page, there is a "view online listing" link you can click on.

Yet Another Perl Programmer

_________________________________
~~> [url=http://www.codingdomain.com]www.codingdomain.com <~~
More then 3500 X-Forum [url=http://www.codingdomain.com/cgi-perl/downloads/x-forum]Downloads! Cool


biggun
Novice

Mar 14, 2002, 5:57 AM

Post #5 of 11 (5076 views)
Re: [yapp] Help with finding a replacement for formmailer [In reply to] Can't Post

Np, im @ school ne way :) btw i sent a bug form to ur webpage.


biggun
Novice

Mar 14, 2002, 6:10 AM

Post #6 of 11 (5075 views)
Re: [biggun] Help with finding a replacement for formmailer [In reply to] Can't Post

could you tell me what to put in the perl path, please as im not sure what to do.
im using IIS in windows xp. got any idea?


(This post was edited by biggun on Mar 14, 2002, 6:13 AM)


yapp
User

Mar 14, 2002, 11:27 AM

Post #7 of 11 (5071 views)
Re: [biggun] Help with finding a replacement for formmailer [In reply to] Can't Post

IIS doesn't need any #!/to/perl/path -w
It's not UNIX for god sake Wink However, perl in windows is so kind to look at the extra arguments (like -w)

I'm running IIS/5.1 aswell. It simply executes .cgi files with C:\perl\bin\perl.exe (if you have configured so).

However, if you haven't:
- although your www-root already has already been setup as "application directory", you want configure the cgi-bin aswell.
- open the properties of the cgi-bin directory in the IIS snapin. Press "Create.." to create an application directory.
- hit "Configuration".
- Now add an new application mapping that maps .cgi to your perl interpreter.
o Executable is C:\perl\bin\perl.exe -w "%s" %s or C:\perl\bin\perlis.dll
o Extension is .cgi (make a second one for .pl later)
o Verbs are GET,HEAD,POST
o If you select script engine, the application will be considered a script. Non-scripts have limited access/executable rights. For example, a directory can allow scripts to run, and deny running executables.
o Check that file exists is very usefull, logically.



In Reply To
Np, im @ school ne way :) btw i sent a bug form to ur webpage.

Cool I've just replies to that report.

Yet Another Perl Programmer

_________________________________
~~> [url=http://www.codingdomain.com]www.codingdomain.com <~~
More then 3500 X-Forum [url=http://www.codingdomain.com/cgi-perl/downloads/x-forum]Downloads! Cool


biggun
Novice

Mar 14, 2002, 11:33 AM

Post #8 of 11 (5069 views)
Re: [yapp] Help with finding a replacement for formmailer [In reply to] Can't Post

bad news :( the link still doesnt work :(


biggun
Novice

Mar 14, 2002, 11:47 AM

Post #9 of 11 (5067 views)
Re: [biggun] Help with finding a replacement for formmailer [In reply to] Can't Post

im trying to get this into your script to collect this information from my site and email to me and the person if possible? if you goto http://cybertechno.no-ip.com/placeorder_bank.html all that information is the thing need to collect, but im almost sure that it stored in the html of the page and some how get binded to the email, using the script below?



# Enter the location of sendmail.

$mailprogram =
"/var/qmail/bin/qmail-inject";

# Enter the fields that are required. They should each be in quotes and
# separated by a comma. If no fields are required, change the next line
# to @required = ();
@required = (
'subject');

# Enter your e-mail address. Be sure to put a \ in front of the @.
# (user@domain.com becomes user\@domain.com)
$youremail =
"lord_kane35\@hotmail.com";

##############################################################################
# Congratulations! You've finished defining the variables. If you want to, #
# you can continue screwing with the script, but it isn't necessary. #
##############################################################################

# Put the posted data into variables

read(STDIN, $buffer, $ENV{
'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-
9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}

# Check for all required fields

foreach $check(@required) {
unless ($FORM{$check}) {
print
"Content-type: text/html\n\n";
print
"<html><head><title>Missing Information</title></head>\n";
print
"<body><h1>Missing Information</h1><br>\n";
print
"I'm sorry, but it would appear that you've forgotten to\n";
print
"fill out the $check field. Please click\n";
print
"back and try again.\n";
print
"</body></html>\n";
exit;
}
}

# Check the senders email

if ($FORM{
'email'}) {
unless ($FORM{
'email'} =~ /\w+@\w+.\w+/) {
print
"Content-type: text/html\n\n";
print
"<html><head><title>Bad E-mail</title></head>\n";
print
"<body><h1>Bad E-mail</h1><br>The e-mail address that you've\n";
print
"entered, $FORM{'email'}, is invalid. Please click back and\n";
print
"try again.\n";
exit;
}
}

open (MAIL,
"|$mailprogram");
print MAIL
"To: $youremail\n";
print MAIL
"Wrom: VWWCUFPEGAUTFJMVRESKPNKMBIPBARHDMNNSKVFVWRKJVZCMHVIBGDADRZFSQHYUCDDJBLVLMHAALPTCXLYRWTQTIPWIGYOKSTTZRCLBDXRQBGJSNBOHMKHJYFMYXOEAIJJPHSCRTNHGSWZIDREXCAXZOWCONEUQZAAFXISHJEXXIMQZUIVOTQNQEMSFDULHPQQWOYIYZUNNYCGPKYLEJGDGVCJVTLBXFGGMEPYOQKEDOTWFAOBUZXUWLSZLKBRNVWWCUFPEGAUTFJMVRESKPNKMBIPBARHDMNNSKVFVWRKJVZCMHVIBGDADRZFSQHYUCDDJBLVLMHAALPTCXLYRWTQTIPWIGYOKSTTZRCLBDXRQBGJSNBOHMKHJYFMYXOEAIJJPHSCRTNHGSWZIDREXCAXZOWCONEUQZAAFXISHJEXXIMQZUIVOTQNQEMSFDULHPQQWOYIYZUNNYCGPKYLEJGDGVCJVTLBXFGGMEPYOQKEDOTWFAOBUZXUWLSZLKBRNVWWCUFPEGAUTFJMVRESKPNKMBIPBARHDMNNSKVFVWRKJVZCMHVIBGDADRZFSQHYUCDDJBLVLMHAALPTCXLYRWTQTIPWIGYOKSTTZRCLBDXRQBGJSNBOHMKHJYFMYXOEAIJJPHSCRTNHGSWZIDREXCAXZOWCONEUQZAAFXISHJEXXIMQZUIVOTQNQEMSFDULHPQQWOYIYZUNNYCGPKYLEJGDGVCJVTLBXFGGMEPYOQKEDOTWFAOBUZXUWLSZLKBRNVWWCUFPEGAUTFJMVRESKPNKMBIPBARHDMNNSKVFVWRKJVZCMHVIBGDADRZFSQHYUCDDJBLVLMHAALPTCXLYRWTQTIPWIGYOKSTTZRCLBDXRQBGJSNBOHMKHJYFMYXOEAIJJPHSCRTNHGSWZIDREXCAXZOWCONEUQZAAFXISHJEXXIMQZUIVOTQNQEMSFDULHPQQWOYIYZUNNYCGPKYLEJGDGVCJVTLBXFGGMEPYOQKEDOTWFAOBUZXUWLSZLKBRNVWWCUFPEGAUTFJMVRESKPNKMBIPBARHDMNNSKVFVface="Courier New" color=#800000 size=2>"email" || $name eq "subject") {
print MAIL
"$name: $value\n";
}
}
close MAIL;

if ($FORM{
'response'} && $FORM{'email'}) {
open (RESPONSE, $FORM{
'response'});
@response = <RESPONSE>;
close(RESPONSE);
open (MAIL,
"|$mailprogram");
print MAIL
"To: $FORM{'email'}\n";
print MAIL
"From: $youremail\n";
print MAIL
"Subject: $FORM{'subject'} -- Autoresponse\n";
foreach $line (@response) {
print MAIL
"$line";
}
print MAIL
"Thankyou for placing an order...\n";
close MAIL;
}

print
"Content-type: text/html\n\n";
print
"<html><head><SCRIPT SRC=\"nopcart.js\"></SCRIPT><script>self.location.href=\"http://cybertechno.no-up.com/finalize.htm\"</script></head><title>loading</title></head>\n";
print
"<body><br>Please wait... \n";
if ($FORM{
'response'} && $FORM{'email'}) {
print
"You should receive an autoresponse shortly.<p>\n";
}
print
"Please click back.\n";


yapp
User

Mar 14, 2002, 12:43 PM

Post #10 of 11 (5063 views)
Re: [biggun] Help with finding a replacement for formmailer [In reply to] Can't Post

Off course you can.

- The message is set up in the SendMailForm() routine. You can adjust that code to make it send the message as you want it to be.
- Add your "all fields are filled in" check aswell. (insert that code before the if (!SendMailForm()) line)
- The SendMail() routine uses an pipe to sendmail. You can properly change that code if you want it to open qmail-inject. (note the extra parameters it receives).
- My script uses the CGI.pm module, since that handles all reading of the input, and takes care of some rare exceptions aswell. In stead of using the $FORM{'VARNAME'} syntax, use the param('VARNAME') function from the CGI module. However, you can't use a function call in a string directly. That's the only problem. However, the param() function has some nice features your %FORM hash can't handle.
- The content-type header is printed using print header('text/html'); Even there some webserver exceptions (like different newlines) are handled.
- If Net/SMTP.pm is found in your @INC path aswell, it will be used to send the e-mail. Mostly it's faster, and you might consider that option.

btw, multiple print statements can be replaced by some <<HERE; block:
[perl]
print header('text/html');
print <<END_OF_HTML;
<html><head><title>Missing Information</title></head>
<body><h1>Missing Information</h1><br>
I'm sorry, but it would appear that you've forgotten to
fill out the $check field. Please click
back and try again.
</body></html>
END_OF_HTML
[/perl]


In Reply To
bad news :( the link still doesnt work :(

Damn. I should have know better. Pirate Uploading a data file is not good enough if a script needs to edit it (update stats) aswell. Fixed, and this time, I tested comletely everthing.Unsure

Yet Another Perl Programmer

_________________________________
~~> [url=http://www.codingdomain.com]www.codingdomain.com <~~
More then 3500 X-Forum [url=http://www.codingdomain.com/cgi-perl/downloads/x-forum]Downloads! Cool


biggun
Novice

Mar 14, 2002, 12:57 PM

Post #11 of 11 (5060 views)
Re: [yapp] Help with finding a replacement for formmailer [In reply to] Can't Post

thanks m8, i got the file now :)

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives