Advertisement
Guest User

Untitled

a guest
Jul 13th, 2017
534
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. //authentication for database
  2. $hostname = "localhost";
  3. $username = "admin";
  4. $password = "xxxxxx";
  5.  
  6. //connection to the database
  7. $dbhandle = mysql_connect($hostname, $username, $password)
  8. or die("Unable to connect to MySQL");
  9.  
  10. //select a database to work with
  11. $selected = mysql_select_db("notification",$dbhandle)
  12. or die("Could not select examples");
  13.  
  14. //execute the SQL query and return records
  15. $result = mysql_query("SELECT * FROM tbl_lead WHERE pass_expiry >= DATE(NOW() + INTERVAL 1 DAY");
  16.  
  17. //variable for email message
  18. $emailBody = "";
  19. $headers = 'From: Pass Validity Reminder' . "rn" .
  20. 'Reply-To: myemail@email.com' . "rn" .
  21. 'Cc: ccemail@Wemail. com' . "rn".
  22. 'X-Mailer: PHP/' . phpversion();
  23. $to = "myemail@email.com";
  24.  
  25. //fetch tha data from the database
  26. while ($row = mysql_fetch_array($result))
  27. {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement