Jump to content

Recommended Posts

Posted

Olá,
 
Estou com um problema no meu formulário de contato bem complicado: Ele não está enviando os e-mails =D
 
Bem, segue o código dele na página de contato:
 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Entre em contato</title>
<link href="estrutura.css" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script>
 
<!-- REVOLUTION BANNER CSS SETTINGS -->
    <link rel="stylesheet" type="text/css" href="imagens/banner/css/fullwidth.css" media="screen" />
<link rel="stylesheet" type="text/css" href="imagens/banner/rs-plugin/css/settings.css" media="screen" />
 
 
     <!-- jQuery KenBurn Slider  -->
<script type="text/javascript" src="imagens/banner/rs-plugin/js/jquery.themepunch.plugins.min.js"></script>
    <script type="text/javascript" src="imagens/banner/rs-plugin/js/jquery.themepunch.revolution.min.js"></script>
</head>
 
<body>
 
<div class="topo"><img src="imagens/logo.jpg" width="984" height="199" /></div>
 
<div class="menu" align="center">
<? include("menu.php"); ?>
</div>
 
<div style="margin:auto; position:relative; padding:20px 0px 50px 0px;" align="center" class="banner">
<div style="background-image:url(imagens/telaContato.png); width:900px; height:640px; margin:auto; position:relative;">
        
        <form method="post" action="enviarEmail.php" style=" padding:100px 35px; width:800px; position:relative;">
        <table width="85%" border="0" cellspacing="1" cellpadding="1">
              <tr>
                <td width="50%" align="center" valign="top"><table width="70%" border="0" cellspacing="1" cellpadding="1">
                  <tr>
                    <td align="left"><p class="texto">GR M&oacute;veis Planejados</p>
                      <p class="texto">R. Marcos Manfrinati, 1.523<br />
                      Jd. Jussara - Ara&ccedil;atuba/SP<br />
                      Tel. (18) 3631-1006/3631-4309<br />
                    contato@grmoveisplanejados.com.br</p></td>
                  </tr>
                  <tr>
                    <td><br /><iframe height="200" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://www.google.com.br/maps?f=d&amp;source=s_d&amp;saddr=R.+Marco+Manfrinati&amp;daddr=&amp;hl=pt-BR&amp;geocode=FYgUvP4dOyn-_A&amp;sll=-21.228399,-50.452175&amp;sspn=0.002068,0.002411&amp;mra=ls&amp;ie=UTF8&amp;t=m&amp;ll=-21.228399,-50.452175&amp;spn=0.002068,0.002411&amp;output=embed"></iframe><br/><small><a href="https://www.google.com.br/maps?f=d&amp;source=embed&amp;saddr=R.+Marco+Manfrinati&amp;daddr=&amp;hl=pt-BR&amp;geocode=FYgUvP4dOyn-_A&amp;sll=-21.228399,-50.452175&amp;sspn=0.002068,0.002411&amp;mra=ls&amp;ie=UTF8&amp;t=m&amp;ll=-21.228399,-50.452175&amp;spn=0.002068,0.002411" style="color:#000000; font-size:11px; text-align:left">Exibir mapa ampliado</a></small></td>
                  </tr>
                </table></td>
                <td align="center" valign="top"><table width="70%" border="0" cellspacing="1" cellpadding="1">
  <tr>
    <td align="left"><span class="texto">Nome:</span></td>
  </tr>
  <tr>
    <td height="30" align="left">
      <input type="text" name="nome" id="nome" size="35" /></td>
  </tr>
  <tr>
    <td align="left"><span class="texto">E-mail:</span></td>
  </tr>
  <tr>
    <td height="30" align="left"><input type="text" name="email" id="email" /></td>
  </tr>
  <tr>
    <td align="left"><span class="texto">Mensagem:</span></td>
  </tr>
  <tr>
    <td align="left">
      <textarea name="mensagem" id="mensagem" cols="30" rows="5"></textarea></td>
  </tr>
  <tr>
    <td height="5" align="left" valign="bottom"></td>
  </tr>
  <tr>
    <td align="left"><input type="image" name="imageField" id="imageField" src="imagens/enviar.jpg" /></td>
  </tr>
                </table>
</td>
              </tr>
            </table>
            </form>
        </div>
</div>
 
<div class="rodape">
<? include("rodape.php"); ?>
</div>
 
</body>
</html>

Agora o arquivo EnviarEmail, que está a configuração em php:

<?
$assu = "Contato pelo Site";
$header  = "From: {$email}\n";
$header .= "Organization: GR Moveis\n";
$header .= "MIME-Version: 1.0\n";
$header .= "Content-Type: text/html; charset=iso-8859-1\n";
$header .= "Content-Transfer-Encoding: 8bit\n";
$mens = "<html><head><title>Entre em contato</title>
</head>
<body bgcolor=#ffffff text=#000000 topmargin=0 leftmargin=0>

<table width=100% align=center>
<tr>
<td width=30%>Nome</td>
<td>$nome</td>
</tr>

<tr>
<td width=30%>E-mail</td>
<td>$email</td>
</tr>

<tr>
<td width=30%>Assunto</td>
<td>$mensagem</td>
</tr>
</table>

</body>";
//mail('contato@grmoveisplanejados.com.br',$assu,$mens,$header);
require_once('class.phpmailer.php');
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded

$mail             = new PHPMailer();

$body             = $mens;
$body             = eregi_replace("[\]",'',$body);

$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host       = "localhost"; // SMTP server
$mail->SMTPDebug  = 0;                     // enables SMTP debug information (for testing)
                                           // 1 = errors and messages
                                           // 2 = messages only
$mail->SMTPAuth   = true;                  // enable SMTP authentication
$mail->Host       = "vps.destakdesign.com.br"; // sets the SMTP server
$mail->Port       = 465;                    // set the SMTP port for the GMAIL server
$mail->Username   = "contato@grmoveisplanejados.com.br"; // SMTP account username
$mail->Password   = "SENHAOCULTADA";        // SMTP account password

$mail->SetFrom($email, $nome);

$mail->AddReplyTo($email, $nome);

$mail->Subject    = $assu;

//$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test

$mail->MsgHTML($body);

$address = "contato@grmoveisplanejados.com.br";
$mail->AddAddress($address, "contato@grmoveisplanejados.com.br");

//$mail->AddAttachment("images/phpmailer.gif");      // attachment
//$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment

if(!$mail->Send()) {
  echo "Mailer Error: " . $mail->ErrorInfo;
} else {
  //echo "Message sent!";
}
    
?>
<script>
alert("E-mail enviado com sucesso.");
window.location.href = 'contato.php';
</script>

 

Sim, eu sei que ele deveria estar aparecendo a mensagem de erro, mas ele não está, a página simplesmente fica em branco.
OU seja, ao clicar em enviar, ele vai para uma página em branco, do nome Enviar.php e simplesmente não envia.
 
Atenciosamente,
Eduardo Rissão

Posted

 

Olá,

 

Estou com um problema no meu formulário de contato bem complicado: Ele não está enviando os e-mails =D

 

Sim, eu sei que ele deveria estar aparecendo a mensagem de erro, mas ele não está, a página simplesmente fica em branco.
OU seja, ao clicar em enviar, ele vai para uma página em branco, do nome Enviar.php e simplesmente não envia.
 
Atenciosamente,

Eduardo Rissão

 

 

Eduardo,

 

Ao criar um post com código experimenta utilizar o botão de código:

 

edvancombr_2015_02_27.jpg
 
Se o código não ficar vísivel utilize o pastebin, exemplo http://pastebin.com/gHiAyP5H
Posted

usa o http://www.jotformz.com/é muito bom e da para personalizar e integrar facilmente em qualquer layout http://i.imgur.com/iwecW2M.png

 

Já usei ele e é muito bom mesmo, eu recomendo.

 

 

Pelo que mostra lá, sim, ele é pago.

 

Se não me engano a versão gratuita é limitada a alguns recursos do formulário, mas da para utilizar perfeitamente para um formulário de contato padrão, sem muita opções.

Posted

Já usei ele e é muito bom mesmo, eu recomendo.

 

 

 

Se não me engano a versão gratuita é limitada a alguns recursos do formulário, mas da para utilizar perfeitamente para um formulário de contato padrão, sem muita opções.

Parece que ele só permite enviar X e-mails no gratuito.

Estou errado?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Do you agree with our terms?