Advertisement
Guest User

Untitled

a guest
Jun 2nd, 2017
525
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.06 KB | None | 0 0
  1. <?php
  2. $DB_Server = "localhost"; //your MySQL Server
  3. $DB_Username = "root"; //your MySQL User Name
  4. $DB_Password = ""; //your MySQL Password
  5. $DB_DBName = "site"; //your MySQL Database Name
  6. $Connect = mysql_connect($DB_Server, $DB_Username, $DB_Password)
  7. or die("Couldn't connect to MySQL:<br>" . mysql_error() . "<br>" . mysql_errno());
  8. $Db = mysql_select_db($DB_DBName, $Connect);
  9.  
  10.  
  11. // Only edit above this line.
  12. $query = "SELECT * FROM `emails` ORDER by `id` DESC LIMIT 20";
  13. $result = mysql_query($query,$Connect);
  14. while($row = mysql_fetch_assoc($result)){
  15. $to      = $row['email'];
  16. $id      = $row['id'];
  17. $subject = 'Join Crusade Gaming Today!'; // Subject line of message
  18. $message = "MESSAGE GOES HERE";
  19. $from    = "newsletter@crusadegaming.net";
  20. $headers = 'From: ' ."$from" . "\r\n" .
  21.     'Reply-To: ' ."$from" . "\r\n" .
  22.     'X-Mailer: PHP/' . phpversion();
  23.  
  24. mail($to, $subject, $message, $headers);
  25. }
  26. mysql_query("DELETE FROM`emails` ORDER by `id` DESC LIMIT 400",$Connect);
  27. $page = "newsletter.php";
  28. $sec="60";
  29. header("Refresh: $sec; url=$page");
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement