Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- include("config.php");
- $variables=(strtolower($_SERVER['REQUEST_METHOD'])== 'GET') ? $_GET : $_POST;
- foreach ($variables as $k=> $v)
- $$k=$v;
- $file = "enviar.php";
- $pg = $_GET['evento'];
- // INICIO DA ACAO ENVIA
- if($acao == "EnviaEmail"){
- $data_envio = date('d/m/Y');
- $hora_envio = date('H:i:s');
- $arquivo = "
- <style type='text/css'>
- body {
- margin-left: 0px;
- margin-top: 0px;
- margin-right: 0px;
- margin-bottom: 0px;
- font-family:$fonte;
- font-size:$tfonte;
- color:$cortexto;
- }
- body,td,th {
- margin-left: 0px;
- margin-top: 0px;
- margin-right: 0px;
- margin-bottom: 0px;
- font-family:$fonte;
- font-size:$tfonte;
- color:$cortexto;
- }
- a:link, a:active, a:visited {
- color:$cortexto;
- text-decoration: none;
- }
- a:hover {
- color:$coronmouse;
- text-decoration: none;
- }
- .titulosG {
- color: $coronmouse;
- font-size: 18;
- font-weight: bold;
- }
- .upcase {
- text-transform:uppercase;
- }
- </style>
- <html>
- <table width='100%' border='0' align='left' cellpadding='10' cellspacing='0'>
- <tr>
- <TD>
- <table border='0' cellspacing='0' cellpadding='0'>
- <tr>
- <td><img src='".$usite."images/layout/img_logop.png'></td>
- </tr>
- </table>
- <table width='100%' border='0' cellpadding='0' cellspacing='0'>
- <tr>
- <td colspan='4' bgcolor='$corcelula1' height='2'></td>
- </tr>
- <tr>
- <td colspan='4' height='1'></td>
- </tr>
- <tr>
- <td colspan='4' bgcolor='$corcelula2' height='1'></td>
- </tr>
- </table>
- <br>
- Olá <b>$nomepara</b>,<br>
- <br>
- Seu amigo(a) <b><a href='mailto:$seuemail'>$seunome</a></b>, esteve em nosso site, e lhe indicou o link abaixo.<br>
- <a href='$url' target='_blank'><b>$url</b></a><br>
- <br>
- <b>$tsite</b><br>
- <a href='$usite'>$usite</a><br><br>
- <table width='100%' border='0' cellspacing='0' cellpadding='0'>
- <tr>
- <td colspan='3' bgcolor='$corcelula1' height='2'></td>
- </tr>
- <tr>
- <td colspan='3' height='1'></td>
- </tr>
- <tr>
- <td colspan='3' bgcolor='$corcelula2' height='1'></td>
- </tr>
- <tr>
- <td>Este e-mail foi enviado em <b>$data_envio</b> às <b>$hora_envio</b></td>
- </tr>
- </table>
- </td></tr>
- </table>
- </html>
- ";
- //echo $arquivo;
- // emails para quem será enviado o formulário (se for mais de um separar com virgula)
- $destino = "$emailpara";
- $assunto = "Indicação de Um Amigo Seu!";
- // É necessário indicar que o formato do e-mail é html
- $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
- $headers .= "From: $seunome <$seuemail>\r\n";
- $email = mail($destino, $assunto, $arquivo, $headers);
- if($email){
- $mgs = "E-MAIL ENVIADO COM SUCESSO!";
- echo " <meta http-equiv='refresh' content='3;URL=javascript:self.close()'>";
- } else {
- $mgs = "ERRO AO ENVIAR E-MAIL!";
- echo " <meta http-equiv='refresh' content='2;URL=javascript:history.go(-1)'>";
- }
- echo "
- <table width='100%' border='0' align='left' cellpadding='10' cellspacing='0'>
- <tr>
- <TD><table border='0' cellspacing='0' cellpadding='0'>
- <tr>
- <td><img src='".$usite."images/layout/img_logop.png'></td>
- <td width='10'></td>
- <td><font class='upcase titulosG'>$tsite</font><br />
- <font size='2'><b>$ssite</b></font></td>
- </tr>
- </table>
- <table width='100%' border='0' cellpadding='0' cellspacing='0'>
- <tr>
- <td colspan='4' bgcolor='$corcelula1' height='2'></td>
- </tr>
- <tr>
- <td colspan='4' height='1'></td>
- </tr>
- <tr>
- <td colspan='4' bgcolor='$corcelula2' height='1'></td>
- </tr>
- </table>
- <br>
- <br>
- <table width='100%' border='0' align='center' cellpadding='0' cellspacing='0' style='border: 1px solid $corcelula1;'>
- <tr><td bgcolor='$corcelula2' align='center' class='titulos'> $mgs</td></tr>
- </table>
- <br>
- </TD></tr>
- </table>
- ";
- }
- // FIM DA ACAO ENVIA
- // INICIO DA ACAO ENVIA
- if(empty($acao)){
- ?>
- <Script Language="JavaScript">
- function validate(theForm) {
- if (theForm.seunome.value == ""){
- alert("Digite seu Nome!");
- theForm.seunome.focus();
- return (false);
- }
- if (theForm.seuemail.value == ""){
- alert("Digite seu E-mail!");
- theForm.seuemail.focus();
- return (false);
- }
- if (theForm.nomepara.value == ""){
- alert("Digite o nome do seu amigo!");
- theForm.nomepara.focus();
- return (false);
- }
- if (theForm.emailpara.value == ""){
- alert("Digite o email do seu amigo!");
- theForm.emailpara.focus();
- return (false);
- }
- return (true);
- }
- </script>
- <form action="<?=$file?>" method="post" onsubmit="return validate(this);">
- <input type="hidden" name="acao" value="EnviaEmail">
- <input type="hidden" name="url" value="<?=$usite."?pg=$pg&id=$id";?>" size="80">
- <table width="100%" border="0" cellspacing="0" cellpadding="3">
- <tr>
- <td>
- <table width="450" border="0" cellpadding="10" cellspacing="2" bgcolor="<?=$corcelula1?>">
- <tr>
- <td valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><img src="images/layout/img_topo_indicar.jpg" /></td>
- </tr>
- <tr>
- <td colspan="3" bgcolor="<?=$corcelula2?>" height="1"></td>
- </tr>
- </table>
- <br />
- <b>Seu amigo(a), receberá no e-mail dele(a) o link abaixo.</b><br />
- <a href="<?=$usite."?pg=$pg&id=$id&q=$q";?>" target="_blank"><?=$usite."?pg=$pg&id=$id&q=$q";?></a>
- <br />
- <br />
- <table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td width="446" align="center" valign="middle"><table width="430" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td width="182" valign="bottom">Seu Nome:<br />
- <input name="seunome" class="input" onblur="this.className='input';" onfocus="this.className='inputon';" style="width:150;" maxlength="100" />
- <br />
- Seu E-mail:<br />
- <input name="seuemail" class="input" onblur="this.className='input';" onfocus="this.className='inputon';" style="width:150;" maxlength="100" /></td>
- <td width="180" valign="bottom">Nome do Amigo:<br />
- <input name="nomepara" class="input" onblur="this.className='input';" onfocus="this.className='inputon';" style="width:150;" maxlength="100" />
- <br />
- E-mail do Amigo:<br />
- <input name="emailpara" class="input" onblur="this.className='input';" onfocus="this.className='inputon';" style="width:150;" maxlength="100" /></td>
- <td width="68" valign="bottom"><input style="width:80px; height:47px;" type="submit" class="input" onblur="this.className='input';" onfocus="this.className='inputon';" name='btgravar' value="ENVIAR"></td>
- </tr>
- </table> </td>
- </tr>
- </table></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </form>
- <?
- }
- // FIM DA ACAO ENVIA
- ?>
Add Comment
Please, Sign In to add comment