Advertisement
Guest User

Untitled

a guest
Dec 5th, 2016
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. <?php
  2. session_start();
  3. $nome = $_POST["nome-contato"];
  4. $email = $_POST["email-contato"];
  5. $mensagem = $_POST["mensagem-contato"];
  6.  
  7. require_once("mailer/mail-autoloader.php");
  8.  
  9. $mail = new PHPMailer();
  10. $mail->isSMTP();
  11. $mail->Host = 'smtp.gmail.com';
  12. $mail->Port = 587;
  13. $mail->SMTPSecure = 'tls';
  14. $mail->SMTPAuth = true;
  15. $mail->Username = "gamboamurilo@gmail.com";
  16. $mail->Password = "Necro145";
  17.  
  18. $mail->setFrom("gamboamurilo@gmail.com", "Murilo Henrique");
  19. $mail->addAddress("gamboamurilo@gmail.com");
  20. $mail->Subject("Email de contato da Nargloth Store");
  21. $mail->msgHTML("<html> de: {$email} <br/> nome: {$nome} <br/><br/> {$mensagem}</html>");
  22. $mail->AltBody = "de: {$email}nnome: {$nome}nn{$mensagem}";
  23.  
  24. if ($mail->send()) {
  25. $_SESSION["success"] = "E-mail enviado com sucesso";
  26. header("Location: index.php");
  27. }else{
  28. $_SESSION["error"] = "Devido a um erro, o seu email não foi enviado" . $mail->ErrorInfo;
  29. header("Location: contato.php");
  30. }
  31. die();
  32.  
  33. ( ! ) Fatal error: Call to undefined method PHPMailer::Subject() in C:wamp64wwwphpIenvia-contato.php on line 20
  34. Call Stack
  35. # Time Memory Function Location
  36. 1 0.0000 249064 {main}( ) ...envia-contato.php:0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement