#!/usr/bin/perl
######################################
#   Autor: Leandro Gomes    v. 1.0   #
#          FormGrátis                #
#                                    #
#          Dúvidas Visite:           #
#        www.cgiclube.net            #
######################################

########### Configuraçăo! ############

$urlformmail = "http://www.cgiclube.net/FormMail.pl";
#Url do seu Formmail.

$nomedosite = "Formulários Grátis";
#Nome do Seu Site

$urldosite = "http://logout.atspace.com/orkut/community/asp/aspxcmm=26038727.html";
#Url do seu site

$sendmail = "/usr/sbin/sendmail";
# PATH completo para o Sendmail, ou outro programa para envio de e-mails em seu servidor

$seumail = "adriano_albuquerque\@yahoo.com.br";
# Seu e-mail (năo esqueça da \ antes da @)


$topcolor = "black";   #Cor da tabela
$bgcolor = "white";    #Cor do Fundo
$link = "red";         #Cor do Link
$vlink = "darkblue";   #Cor do Link Visitado

$header = ""; 
#Parte de cima de seu HTML caso tenha


$footer = ""; 
#Parte de Baixo do seu HTML caso tenha

########### NĂO EDITE MAIS NADA DAQUI PARA BAIXO! ############

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;
}

###########################################
# Enviando email para o indicado
###########################################

open (MENSAGEM,"$mensagem");
@lines = <MENSAGEM>;
close (MENSAGEM);

open (MAIL,"|$sendmail");
print MAIL "To: $FORM{'receptor'}\n";
print MAIL "From: $seumail\n";
print MAIL "Subject: Código do meu Fórmulário Grátis\n";
print MAIL "Olá $FORM{'nome'} Seu Formulário Foi feito com sucesso \n";
print MAIL "\n";
print MAIL "Suas informaçőes Foram:\n";
print MAIL "Nome: $FORM{'nome'}\n";
print MAIL "Email do Receptor: $FORM{'receptor'}\n";
print MAIL "URL de Obrigado: $FORM{'url'}\n";
print MAIL "\n";
print MAIL "Abaixo está o Código HTML de Seu Formulário\n";
print MAIL "Copie e cole em qualquer lugar de seu HTML\n";
print MAIL "\n";
print MAIL "

<!-- Fórmulário Grátis - Aqui começa o código --> 
<form method=\"post\" action=\"$urlformmail\"> <input type=\"hidden\" name=\"recipient\" value=\"$FORM{'receptor'}\"> <input type=\"hidden\" name=\"redirect\" value=\"$FORM{'url'}\"> <table width=\"75%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr> <td width=\"18%\"><font size=\"1\" face=\"Verdana\">Nome:</font></td> <td width=\"38%\"> <input type=\"text\" name=\"nome\" size=\"24\"></td> <td width=\"44%\" rowspan=\"5\">&nbsp; <textarea name=\"Comentarios\" rows=\"8\" cols=\"20\"></textarea></td> </tr><tr> <td width=\"18%\"><font size=\"1\" face=\"Verdana\">E-mail:</font></td> <td width=\"38%\"> <input type=\"text\" name=\"email\" size=\"24\"></td></tr><tr> <td width=\"18%\"><font size=\"1\" face=\"Verdana\">Home Page:</font></td> <td width=\"38%\"> <input type=\"text\" name=\"HomePage\" size=\"24\"> </td> </tr><tr> <td width=\"18%\" bordercolor=\"#CCCCCC\"><font size=\"1\" face=\"Verdana\">Assunto:</font></td> <td width=\"38%\"> <input type=\"text\" name=\"subject\" size=\"24\"></td></tr> <tr> <td width=\"18%\" height=\"20\"></td> <td width=\"38%\" height=\"20\"> <input type=\"submit\" name=\"Submit\" value=\"Enviar\"> <input type=\"reset\" name=\"Submit\" value=\"Limpar\"></td></tr> </table> </form> 
<!-- Formulário Grátis - Aqui termina o código --> 

\n";
print MAIL "\n";
print MAIL "$nomedosite\n";
print MAIL "$urldosite";
close MAIL;


print "Content-type: text/html\n\n";
print "<html><head><title>$nomedosite</title></head>\n";
print "<body bgcolor=$bgcolor link=$link vlink=$vlink>\n";
print "<center>\n";
print "$header\n";
print "<font color=black size=-1 face=verdana><center><B>$FORM{'nome'}</b> Obrigado por usar nosso Formulário !<BR>
Nesse Momento Enviamos um email para <B><BR><font color=red>$FORM{'receptor'}</font><BR></B> com o Código HTML do Formulário.<BR> <BR> \n";
print " <center><B><font color=black size=2 face=verdana>Suas Informaçőes foram:</B></center><BR>\n";
print " <table>
<td bgcolor=F0F0F0><font color=black size=2 face=verdana>Seu Nome: </td><td bgcolor=F0F0F0><font color=black size=2 face=verdana><font color=red>$FORM{'nome'}</font></td>
<tr>
  <td><font color=black size=2 face=verdana>Receptor: </td><td><font color=black size=2 face=verdana><font color=red>$FORM{'receptor'}</font></td>
<tr>
<td bgcolor=F0F0F0><font color=black size=2 face=verdana>Url de Obrigado: </td><td bgcolor=F0F0F0><font color=black size=2 face=verdana><font color=red>$FORM{'url'}</font></td></table>\n";
print " </center></font>\n";
print "<p>\n";
print "<center><table border=1 cellpadding=0 cellspacing=0 width=430>\n";
print "<tr><td bgcolor=$topcolor><font color=white size=-1 face=verdana><b><CENTER>Abaixo está o código HTML do Seu Formulário</b></center></font></td></tr>\n";
print "<tr><td><font color=black size=-1 face=verdana>\n";
print "<br><font size=2 face=tahoma> &lt;!-- Fórmulário Grátis - Aqui começa o c&oacute;digo --&gt; <BR>
&lt;form method=&quot;post&quot; action=&quot;$urlformmail&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;recipient&quot; value=&quot;$FORM{'receptor'}&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;redirect&quot; value=&quot;$FORM{'url'}&quot;&gt;
&lt;table width=&quot;75%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;&lt;tr&gt;
&lt;td width=&quot;18%&quot;&gt;&lt;font size=&quot;1&quot; face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;Nome:&lt;/font&gt;&lt;/td&gt;
&lt;td width=&quot;38%&quot;&gt;
&lt;input type=&quot;text&quot; name=&quot;nome&quot; size=&quot;24&quot;&gt;&lt;/td&gt;
&lt;td width=&quot;44%&quot; rowspan=&quot;5&quot;&gt;&amp;nbsp;
&lt;textarea name=&quot;Comentarios&quot; rows=&quot;8&quot; cols=&quot;20&quot;&gt;&lt;/textarea&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td width=&quot;18%&quot;&gt;&lt;font size=&quot;1&quot; face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;E-mail:&lt;/font&gt;&lt;/td&gt;
&lt;td width=&quot;38%&quot;&gt;
&lt;input type=&quot;text&quot; name=&quot;email&quot; size=&quot;24&quot;&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;
&lt;td width=&quot;18%&quot;&gt;&lt;font size=&quot;1&quot; face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;Home
Page:&lt;/font&gt;&lt;/td&gt;
&lt;td width=&quot;38%&quot;&gt;
&lt;input type=&quot;text&quot; name=&quot;HomePage&quot; size=&quot;24&quot;&gt;
&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt;
&lt;td width=&quot;18%&quot; bordercolor=&quot;#CCCCCC&quot;&gt;&lt;font size=&quot;1&quot;
face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;Assunto:&lt;/font&gt;&lt;/td&gt;
&lt;td width=&quot;38%&quot;&gt;
&lt;input type=&quot;text&quot; name=&quot;subject&quot; size=&quot;24&quot;&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;
&lt;td width=&quot;18%&quot; height=&quot;20&quot;&gt;&lt;/td&gt;
&lt;td width=&quot;38%&quot; height=&quot;20&quot;&gt;
&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Enviar&quot;&gt;
&lt;input type=&quot;reset&quot; name=&quot;Submit&quot; value=&quot;Limpar&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt; <BR>
&lt;!-- Formulário Grátis - Aqui termina o c&oacute;digo --&gt; <BR><BR>\n";
print "</td></tr></table></center><BR>\n";
print "$footer";
print "<noframes></html><noframes></noscript><!-- --></noscript></noscript><p>\n";
exit;


