Advertisement
Guest User

Untitled

a guest
May 14th, 2016
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.78 KB | None | 0 0
  1. <?php
  2.     require("libphp-phpmailer/class.phpmailer.php");
  3.     // configuration
  4.     require("../includes/config.php");
  5.  $id = $_SESSION["id"];
  6.  $email = CS50:: query(" SELECT email FROM users WHERE id = ?",$id);
  7.  
  8.     $mail = new PHPMailer();
  9.    
  10.     $mail -> IsSMTP();
  11.     $mail -> Host = "smtp.gmail.com";
  12.     $mail -> Password = "******";
  13.     $mail -> Port = 587;
  14.     $mail -> SMTPAuth = true;
  15.     $mail -> SMTPDebug = 1;
  16.     $mail -> SMTPSecure = "tls";
  17.     $mail -> Username = "cs50finance8@gmail.com";
  18.     $mail->isHTML(true);
  19.     $mail -> SetFrom("cs50finance8@gmail.com");
  20.     $mail -> Body = "click this link to reset your cs50 finance password https://ide50-yusufhelal.cs50.io/reset.php";
  21.    
  22.     $mail -> addAddress($email["0"]["email"]);
  23.     $mail -> Send();
  24.    
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement