Advertisement
Guest User

Untitled

a guest
Feb 27th, 2015
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.48 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  5. <title>Entre em contato</title>
  6. <link href="estrutura.css" rel="stylesheet" type="text/css" />
  7. <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
  8. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script>
  9.  
  10. <!-- REVOLUTION BANNER CSS SETTINGS -->
  11. <link rel="stylesheet" type="text/css" href="imagens/banner/css/fullwidth.css" media="screen" />
  12. <link rel="stylesheet" type="text/css" href="imagens/banner/rs-plugin/css/settings.css" media="screen" />
  13.  
  14.  
  15. <!-- jQuery KenBurn Slider -->
  16. <script type="text/javascript" src="imagens/banner/rs-plugin/js/jquery.themepunch.plugins.min.js"></script>
  17. <script type="text/javascript" src="imagens/banner/rs-plugin/js/jquery.themepunch.revolution.min.js"></script>
  18. </head>
  19.  
  20. <body>
  21.  
  22. <div class="topo"><img src="imagens/logo.jpg" width="984" height="199" /></div>
  23.  
  24. <div class="menu" align="center">
  25. <? include("menu.php"); ?>
  26. </div>
  27.  
  28. <div style="margin:auto; position:relative; padding:20px 0px 50px 0px;" align="center" class="banner">
  29. <div style="background-image:url(imagens/telaContato.png); width:900px; height:640px; margin:auto; position:relative;">
  30.  
  31. <form method="post" action="enviarEmail.php" style=" padding:100px 35px; width:800px; position:relative;">
  32. <table width="85%" border="0" cellspacing="1" cellpadding="1">
  33. <tr>
  34. <td width="50%" align="center" valign="top"><table width="70%" border="0" cellspacing="1" cellpadding="1">
  35. <tr>
  36. <td align="left"><p class="texto">GR M&oacute;veis Planejados</p>
  37. <p class="texto">R. Marcos Manfrinati, 1.523<br />
  38. Jd. Jussara - Ara&ccedil;atuba/SP<br />
  39. Tel. (18) 3631-1006/3631-4309<br />
  40. contato@grmoveisplanejados.com.br</p></td>
  41. </tr>
  42. <tr>
  43. <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>
  44. </tr>
  45. </table></td>
  46. <td align="center" valign="top"><table width="70%" border="0" cellspacing="1" cellpadding="1">
  47. <tr>
  48. <td align="left"><span class="texto">Nome:</span></td>
  49. </tr>
  50. <tr>
  51. <td height="30" align="left">
  52. <input type="text" name="nome" id="nome" size="35" /></td>
  53. </tr>
  54. <tr>
  55. <td align="left"><span class="texto">E-mail:</span></td>
  56. </tr>
  57. <tr>
  58. <td height="30" align="left"><input type="text" name="email" id="email" /></td>
  59. </tr>
  60. <tr>
  61. <td align="left"><span class="texto">Mensagem:</span></td>
  62. </tr>
  63. <tr>
  64. <td align="left">
  65. <textarea name="mensagem" id="mensagem" cols="30" rows="5"></textarea></td>
  66. </tr>
  67. <tr>
  68. <td height="5" align="left" valign="bottom"></td>
  69. </tr>
  70. <tr>
  71. <td align="left"><input type="image" name="imageField" id="imageField" src="imagens/enviar.jpg" /></td>
  72. </tr>
  73. </table>
  74. </td>
  75. </tr>
  76. </table>
  77. </form>
  78. </div>
  79. </div>
  80.  
  81. <div class="rodape">
  82. <? include("rodape.php"); ?>
  83. </div>
  84.  
  85. </body>
  86. </html>
  87.  
  88. Agora o arquivo EnviarEmail, que está a configuração em php:
  89.  
  90. <?
  91. $assu = "Contato pelo Site";
  92. $header = "From: {$email}\n";
  93. $header .= "Organization: GR Moveis\n";
  94. $header .= "MIME-Version: 1.0\n";
  95. $header .= "Content-Type: text/html; charset=iso-8859-1\n";
  96. $header .= "Content-Transfer-Encoding: 8bit\n";
  97. $mens = "<html><head><title>Entre em contato</title>
  98. </head>
  99. <body bgcolor=#ffffff text=#000000 topmargin=0 leftmargin=0>
  100.  
  101. <table width=100% align=center>
  102. <tr>
  103. <td width=30%>Nome</td>
  104. <td>$nome</td>
  105. </tr>
  106.  
  107. <tr>
  108. <td width=30%>E-mail</td>
  109. <td>$email</td>
  110. </tr>
  111.  
  112. <tr>
  113. <td width=30%>Assunto</td>
  114. <td>$mensagem</td>
  115. </tr>
  116. </table>
  117.  
  118. </body>";
  119. //mail('contato@grmoveisplanejados.com.br',$assu,$mens,$header);
  120. require_once('class.phpmailer.php');
  121. //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
  122.  
  123. $mail = new PHPMailer();
  124.  
  125. $body = $mens;
  126. $body = eregi_replace("[\]",'',$body);
  127.  
  128. $mail->IsSMTP(); // telling the class to use SMTP
  129. $mail->Host = "localhost"; // SMTP server
  130. $mail->SMTPDebug = 0; // enables SMTP debug information (for testing)
  131. // 1 = errors and messages
  132. // 2 = messages only
  133. $mail->SMTPAuth = true; // enable SMTP authentication
  134. $mail->Host = "vps.destakdesign.com.br"; // sets the SMTP server
  135. $mail->Port = 465; // set the SMTP port for the GMAIL server
  136. $mail->Username = "contato@grmoveisplanejados.com.br"; // SMTP account username
  137. $mail->Password = "SENHAOCULTADA"; // SMTP account password
  138.  
  139. $mail->SetFrom($email, $nome);
  140.  
  141. $mail->AddReplyTo($email, $nome);
  142.  
  143. $mail->Subject = $assu;
  144.  
  145. //$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
  146.  
  147. $mail->MsgHTML($body);
  148.  
  149. $address = "contato@grmoveisplanejados.com.br";
  150. $mail->AddAddress($address, "contato@grmoveisplanejados.com.br");
  151.  
  152. //$mail->AddAttachment("images/phpmailer.gif"); // attachment
  153. //$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment
  154.  
  155. if(!$mail->Send()) {
  156. echo "Mailer Error: " . $mail->ErrorInfo;
  157. } else {
  158. //echo "Message sent!";
  159. }
  160.  
  161. ?>
  162. <script>
  163. alert("E-mail enviado com sucesso.");
  164. window.location.href = 'contato.php';
  165. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement