Advertisement
Guest User

Untitled

a guest
May 27th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. <?php
  2. require 'PHPMailer-master\PHPMailerAutoload.php';
  3. $clienteEmail = $_POST["email"];
  4. $mail = new PHPMailer;
  5. //$mail->SMTPDebug = 3; // Enable verbose debug output
  6. $mail->isSMTP(); // Set mailer to use SMTP
  7. //$mail->SMTPDebug = 2;
  8. //$mail->Debugoutput = 'html';
  9. $mail->Host = ' smtp-mail.outlook.com;'; // Specify main and backup SMTP servers
  10. $mail->SMTPAuth = true; // Enable SMTP authentication
  11. $mail->Username = 'lucas2213690@outlook.com'; // SMTP username
  12. $mail->Password = 'XXXXXXXXXXXXX'; // SMTP password
  13. $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
  14. $mail->Port = 587; // TCP port to connect to
  15. $mail->setFrom('lucas2213690@outlook.com'); // Add a recipient
  16. $mail->addAddress('lucas2213690@gmail.com'); // Name is optional
  17. //$mail->isHTML(true); // Set email format to HTML
  18. $mail->Subject = 'Here is the subject';
  19. $mail->Body = 'This is the HTML message body <b>in bold!</b>';
  20. $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
  21. if(!$mail->send()) {
  22. echo 'Message could not be sent.';
  23. echo 'Mailer Error: ' . $mail->ErrorInfo;
  24. } else {
  25. echo 'Message has been sent';
  26. }
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement