Ciao ragazzi, non fatevi impressionare dalle lunghezza...in pratica non riesco a far funzionare un form per e-mail, cioè non riesco a ricevere il messaggio...
questa è l'actions che sta sul pulsante "INVIA":
on (press, keyPress "<Enter>") {
response = "response.txt";
subject = "nikname@email.it ";
if (nome eq "") {
error.gotoAndStop("nome");
} else if (cognome eq "") {
error.gotoAndStop("cognome");
} else if (indirizzo eq "") {
error.gotoAndStop("indirizzo");
} else if (città eq "") {
error.gotoAndStop("città");
}
else if (telefono eq "") {
error.gotoAndStop("telefono");
} else if (fax eq "") {
error.gotoAndStop("fax");
} else if (email eq "") {
error.gotoAndStop("email");
} else if (richiesta eq "") {
error.gotoAndStop("richiesta");
} else {
loadVariablesNum("http://www.miosito.it/cgi-bin/forma2.cgi", 0, "POST");
error.gotoAndStop("grazie");
}
}
Questo invece è il file "forma2.cgi":
#!/usr/bin/perl
################################################## ############################
# Willem's Form Mailer with autoresponse Version 1.0 #
# Copyright 1999 Flashproductions #
# Created 8/7/99 #
# Available at http://www.flashproductions.nl #
################################################## ############################
# COPYRIGHT NOTICE #
# Copyright 1999 Flashroductions All Rights Reserved. #
# #
# This script can be used\modified free of charge. #
# #
# If you really need to remove this part, go to #
# http://www.Flashproductions.nl . By using this script #
# you agree to indemnifyme from any liability that might arise from its use. #
# In simple English, if this script somehow makes your computer run amuck #
# and kill the pope, it's not my fault. #
# #
# This script can redder used for Flashforms and plain Html forms. #
# #
# In Flash use the Load variable to go to the cgi url. #
# Also don't forget to load the variable response.txt, #
# #
# In plain HTML the script writes html documents if you send the form. #
################################################## ############################
# Enter the location of sendmail.
$mailprogram = "/usr/sbin/sendmail";
# 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 = ('email','subject');
# Enter your e-mail address. Be sure to put a \ in front of the @.
# (user@domain.com becomes user\@domain.com)
$youremail = "nikname\@email.it ";
################################################## ############################
# 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>Attenzione</title></head>\n";
print "<body><h1>Non hai compilato tutti i campi</h1>
\n";
print "\n";
print "compila il campo $check field!\n";
print "e prova ancora\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>Indirizzo e-mail errato</title></head>\n";
print "<body><h1>Indirizzo e-mail errato</h1>
Il formato email deve essere\n";
print "non è, $FORM{'email'}, validi. Riprova\n";
print "ancora\n";
exit;
}
}
open (MAIL,"|$mailprogram");
print MAIL "To: $youremail\n";
print MAIL "From: $FORM{'email'}\n";
print MAIL "Subject: $FORM{'subject'}\n";
print MAIL "E-mail inviata da miosito.it.\n";
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
unless ($name eq "response" || $name eq "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'} -- Risposta Automatica\n";
foreach $line (@response) {
print MAIL "$line";
}
print MAIL "\n";
print MAIL "\n";
print MAIL "\n";
print MAIL "\n";
close MAIL;
}
print "Content-type: text/html\n\n";
print "<html><head><title>Dank u wel!</title></head>\n";
print "<body><h1>Grazie!</h1>
\n";
print"<body><h3> Grazie</h3>
\n";
if ($FORM{'response'} && $FORM{'email'}) {
print "Un messaggio di risposta automatico è stato inviato
\n";
}
print "Buona permanenza in miosito.it.\n";
Per caso bisogna modificare qualche altra cosa oltre alle parti che ho evidenziato con il bold