Guest User

Untitled

a guest
Feb 13th, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. <?php
  2.  
  3. require 'PHPMailer/PHPMailerAutoload.php';
  4. $mail = new PHPMailer;
  5. $mail->isSMTP();
  6. $mail->Host = 'smtp.live.com';
  7. $mail->Port = 587;
  8. $mail->SMTPSecure = 'tsl';
  9. $mail->SMTPAuth = true;
  10. $mail->Username = "[email protected]";
  11. $mail->Password = "minhasenha";
  12.  
  13. //Define os destinatário(s)
  14. //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  15. $mail->AddAddress('[email protected]');
  16.  
  17. //Define o remetente
  18. // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  19. $mail->AddReplyTo($_POST['email'], $_POST['nome']);
  20. $mail->Sender=$_POST['email'];
  21. $mail->SetFrom($_POST['email'], $_POST['nome']);
  22.  
  23. //$mail->FromName="FromName que eu quero";
  24. //$mail->From=$_POST['email'];
  25.  
  26. $mail->Subject = $_POST['assunto'];
  27. $mail->Body = $_POST['mensagem'];
  28.  
  29. if (!$mail->send()) {
  30. echo "Mailer Error: " . $mail->ErrorInfo;
  31. } else {
  32. echo "Message sent!";
  33. }
Advertisement
Add Comment
Please, Sign In to add comment