Advertisement
Guest User

Untitled

a guest
Apr 13th, 2017
553
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. <?php
  2. if (getenv("REQUEST_METHOD") == "POST")
  3. {
  4. $nome = $_POST['nome'];
  5. $email = $_POST['email'];
  6. $obs = $_POST['mensagem'];
  7. require_once('PHPMailer/class.phpmailer.php');
  8. $mail= new PHPMailer;
  9. $mail->IsSMTP(); // Ativar SMTP
  10. $mail->SMTPDebug = 2; // Debugar: 1 = erros e mensagens, 2 = mensagens apenas
  11. $mail->SMTPAuth = true; // Autenticação ativada
  12. $mail->Host = 'xxxxxx'; // SMTP utilizado
  13. $mail->Port = 25;
  14. $mail->Username = 'contato@gmail.com';
  15. $mail->Password = '';
  16. $mail->SetFrom('contato@gmail.com');
  17. $mail->addAddress('contato@gmail.com');
  18. $mail->addAddress('$email');
  19. $mail->Subject=("Solicitação");
  20. $mail->msgHTML("Olá, o cliente $nome, solicitou algumas informacoes <br /><br />
  21. Nome do solicitante: <b>$nome</b> <br />
  22. E-mail do solicitante: <b>$email</b> <br />
  23. OBS: $obs <br /><br />
  24. Responda o mais breve possivel.");
  25. if ($mail->send()){
  26. $ok = true;
  27. }else{
  28. $ok = false;
  29. } }
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement