Advertisement
Guest User

Untitled

a guest
Feb 15th, 2016
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.97 KB | None | 0 0
  1. Parse error: syntax error, unexpected T_FUNCTION in /home/storage/1/8e/5d/tecmovgruas2/public_html/phpmailer/class.phpmailer.php on line 3040
  2.  
  3. protected function clearQueuedAddresses($kind)
  4. {
  5. if (version_compare(PHP_VERSION, '5.3.0', '<')) {
  6. $RecipientsQueue = $this->RecipientsQueue;
  7. foreach ($RecipientsQueue as $address => $params) {
  8. if ($params[0] == $kind) {
  9. unset($this->RecipientsQueue[$address]);
  10. }
  11. }
  12. } else {
  13. $this->RecipientsQueue = array_filter(
  14. $this->RecipientsQueue,
  15. function ($params) use ($kind) {
  16. return $params[0] != $kind;
  17. });
  18. }
  19. }
  20.  
  21. <form id="main-contact-form1" name="contact-form" action="envio.php" method="post">
  22. <div class="row wow fadeInUp" data-wow-duration="1000ms" data-wow-delay="300ms">
  23. <div class="col-sm-6">
  24. <div class="form-group">
  25. <input type="text" name="name" class="form-control" placeholder="Nome" required="required">
  26. </div>
  27. </div>
  28. <div class="col-sm-6">
  29. <div class="form-group">
  30. <input type="email" name="email" class="form-control" placeholder="E-mail" required="required">
  31. </div>
  32. </div>
  33. </div>
  34. <div class="form-group">
  35. <input type="text" name="subject" class="form-control" placeholder="Assunto" required="required">
  36. </div>
  37. <div class="form-group">
  38. <textarea name="message" id="message" class="form-control" rows="4" placeholder="Escreva sua Mensagem" required="required"></textarea>
  39. </div>
  40. <div class="form-group">
  41. <button type="submit" class="btn-submit">Enviar</button>
  42. </div>
  43. </form>
  44.  
  45. <?php
  46. $Nome = $_POST["name"]; // Pega o valor do campo Nome
  47. $Email = $_POST["email"]; // Pega o valor do campo Telefone
  48. $Assunto = $_POST["subject"]; // Pega o valor do campo Email
  49. $Mensagem = $_POST["message"]; // Pega os valores do campo Mensagem
  50.  
  51. // Variável que junta os valores acima e monta o corpo do email
  52.  
  53. $Vai = "Nome: $NomennE-mail: $EmailnnAssunto: $AssuntonnMensagem: $Mensagemn";
  54. /*date_default_timezone_set('Etc/UTC');
  55. */
  56. require("phpmailer/PHPMailerAutoload.php");
  57. require("phpmailer/class.smtp.php");
  58.  
  59. define('GUSER', 'contato@tecmovgruas.com'); // <-- Insira aqui o seu GMail
  60. define('GPWD', 'lalala'); // <-- Insira aqui a senha do seu GMail
  61.  
  62. /*define('GUSER', 'tecmovlocacao@gmail.com');
  63. define('GPWD', 'tralalala'); */
  64. function smtpmailer($para, $de, $de_nome, $assunto, $corpo) {
  65. global $error;
  66. $mail = new PHPMailer();
  67. $mail->setLanguage('pt');
  68. $mail->IsSMTP(); // Ativar SMTP
  69. $mail->SMTPDebug = 0; // Debugar: 1 = erros e mensagens, 2 = mensagens apenas
  70. $mail->SMTPAuth = true; // Autenticação ativada
  71. $mail->SMTPSecure = 'tsl'; // SSL REQUERIDO pelo GMail
  72. $mail->Host = 'smtp.gmail.com'; // SMTP utilizado
  73. $mail->Port = 587; // A porta 587 deverá estar aberta em seu servidor
  74. $mail->Username = GUSER;
  75. $mail->Password = GPWD;
  76. $mail->SetFrom($de, $de_nome);
  77. $mail->Subject = $assunto;
  78. $mail->Body = $corpo;
  79. $mail->AddAddress($para);
  80. if(!$mail->Send()) {
  81. $error = 'Mail error: '.$mail->ErrorInfo;
  82. return false;
  83. } else {
  84. $error = 'Mensagem enviada!';
  85. return true;
  86. }
  87. }
  88.  
  89. // Insira abaixo o email que irá receber a mensagem, o email que irá enviar (o mesmo da variável GUSER),
  90.  
  91. if (smtpmailer('tecmovlocacao@gmail.com', 'tecmovlocacao@gmail.com', 'renata', 'Assunto do Email', $Vai)) {
  92.  
  93. Header("location:obrigado.html"); // Redireciona para uma página de obrigado.
  94.  
  95. }
  96. if (!empty($error)) echo $error;
  97. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement