comparison newsletter/newsletter_110301.php @ 6:077b0a0a3e6d

remaining originals according to dependency walk
author Robert Boland <robert@markup.co.uk>
date Thu, 16 Feb 2017 22:29:02 +0000
parents
children 385ddd7c4b55 a67bf725e87b
comparison
equal deleted inserted replaced
5:55445b456ad0 6:077b0a0a3e6d
1 <?PHP
2
3 include "../../private/db.php";
4
5 $myFile = "newsletterOutput";
6 $fh = fopen($myFile, 'w') or die("can't open file");
7
8 for ( $counter = 0; $counter <= 5200; $counter += 50) {
9
10 $upper = $counter+51;
11
12 $query1 = "select distinct Email from user u, userpref up where u.UserID = up.UserID and ReceiveEmail = 1 and u.UserID > $counter and u.UserID < $upper";
13 //echo $query1;
14
15 $data = mysqli_query($link, $query1);
16
17 fwrite($fh, date("d/m/y : H:i:s", time()));
18 fwrite($fh, " Sent mail to:\n");
19
20 while($line = mysqli_fetch_assoc($data))
21 {
22 $email=$line["Email"];
23
24 if (substr($email,0,1) != "@")
25 {
26
27 $message = "<html>
28 <head>
29 <title>YourNextRead Newsletter</title>
30 </head>
31 <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" bgcolor=\"#232323\" align=\"center\">
32 <tbody><tr><td>
33 <table width=\"600\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" bgcolor=\"#ffffff\" align=\"center\">
34
35 <tbody>
36 <tr></tr>
37 <tr>
38 <td bgcolor=\"#232323\" width=\"15\"></td>
39 <td bgcolor=\"#232323\">
40 <center><font face=\"verdana, sans-serif, arial\" color=\"#ffffff\" style=\"font-size:10px;\" size=\"1\">
41 Discover and share with YourNextRead. Having trouble viewing this email? See it <a rel=\"nofollow\" target=\"_blank\" href=\"http://www.yournextread.com/newsletter/mar0111.html\" style=\"color:#ffffff;\">online<font face=\"verdana, sans-serif, arial\" color=\"#ffffff\" style=\"font-size:10px;\" size=\"1\"></font></a>. To help stop our emails being seen as spam, please add <strong><span style=\"border-bottom-style: dashed; border-bottom-width: 1px; border-bottom-color: rgb(0, 102, 204); cursor: pointer; \">newsletter@YourNextRead.com</span></strong> to your address book.
42 <br><br>
43 </font></center>
44 </td>
45 <td bgcolor=\"#232323\" width=\"15\"></td>
46 </tr>
47
48 <tr>
49 <td colspan=\"3\" bgcolor=\"#232323\" ><A HREF=\"http://www.yournextread.com/\"><img src=\"http://www.yournextread.com/images/read/top_email.jpg\" style=\"border:0px;display:block;\" width=\"600\" height=\"63\" alt=\"\"></a></td>
50 </tr>
51
52 <tr>
53 <td bgcolor=\"#ffffff\" colspan=\"2\">
54 <table width=\"600\" cellpadding=\"5\" cellspacing=\"0\" border=\"0\" bgcolor=\"#ffffff\">
55 <tbody>
56 <tr>
57 <td bgcolor=\"#594f43\"> <font face=\"verdana, sans-serif, arial\" color=\"#ffffff\" style=\"font-size:12px;\">
58 1st March 2011
59 </font> </td>
60 </tr>
61 <tr>
62 <td bgcolor=\"#f2b234\">
63 <font face=\"verdana, sans-serif, arial\" color=\"#232323\" style=\"font-size:20px; font-weight:bold;\">
64 YourNextRead - Even More Book Ideas!
65 </font>
66 <br>
67 </td>
68 </tr>
69 </tbody>
70 </table>
71 </td>
72 </tr>
73 <tr></tr>
74 <tr>
75 <td bgcolor=\"#ffffff\" colspan=\"3\">
76 <table width=\"570\" cellpadding=\"10\" cellspacing=\"0\" border=\"0\" bgcolor=\"#ffffff\">
77 <tbody>
78 <tr>
79 <td>
80 <font face=\"verdana, sans-serif, arial\" color=\"#0000000\" style=\"font-size:12px;\"></font>
81 <p style=\"font-family:verdana, sans-serif, arial;font-weight:100;color:#0000000;font-size:13px;line-height:14px;\">
82 We have been busy for the last month thinking of new ways to improve YourNextRead’s recommendations.</p>
83 <p style=\"font-family:verdana, sans-serif, arial;font-weight:100;color:#0000000;font-size:13px;line-height:14px;\">The recommendations from our community (that's you!) are the most important part of our website and always will be. But we're getting more and more popular, and we're finding that some books have more recommendations than we can show! </p><p style=\"font-family:verdana, sans-serif, arial;font-weight:100;color:#0000000;font-size:13px;line-height:14px;\">To help give you as many ideas as possible, we have added a new rotation system for books with lots of recommendations.
84 </p>
85 <p style=\"font-family:verdana, sans-serif, arial;font-weight:100;color:#0000000;font-size:13px;line-height:14px;\"><a href=\"http://www.yournextread.com/\">Try it out</a> and <a href=\"mailto:feedback@yournextread.com\">let us know what you think!</a></p>
86 <div style=\"border-bottom:solid;border-bottom-width:2px;border-bottom-color:#f2b234;height:1px;width:570px;margin-top:8px;margin-bottom:10px;\"></div>
87 </p><p style=\"font-family:verdana, sans-serif, arial;font-weight:100;color:#0000000;font-size:13px;line-height:14px;\">
88 We also have some exciting new releases coming up soon, so keep your eyes peeled for our next newsletter... All the best from the YourNextRead team.
89 </p>
90
91 <p style=\"font-family:verdana, sans-serif, arial;font-weight:bold;color:#0000000;text-align:center;font-size:13px;line-height:14px;\">
92 Check out the YourNextRead recommendations for these bestsellers:
93 </p>
94 <p style=\"text-align:center;\">
95 <a href=\"http://www.yournextread.com/us/#!isbn=0307587959\"><img src=\"http://ecx.images-amazon.com/images/I/51vMkxhAVWL._SL160_.jpg\" height =\"100px\" width=\"70px\"/></a>
96 <a href=\"http://www.yournextread.com/us/#!isbn=0470947802\"><img src=\"http://ecx.images-amazon.com/images/I/51n7yqvo5DL._SL160_.jpg\" height =\"100px\" width=\"70px\"/></a>
97 <a href=\"http://www.yournextread.com/us/#!isbn=0849946158\"><img src=\"http://ecx.images-amazon.com/images/I/41EPLI2HNBL._SL160_.jpg\" height =\"100px\" width=\"70px\"/></a>
98 <a href=\"http://www.yournextread.com/us/#!isbn=0756404738\"><img src=\"http://ecx.images-amazon.com/images/I/51ZQ%2BYN6EyL._SL160_.jpg\" height =\"100px\" width=\"70px\"/></a>
99 <a href=\"http://www.yournextread.com/us/#!isbn=1400064163\"><img src=\"http://ecx.images-amazon.com/images/I/51BsGJZ989L._SL160_.jpg\" height =\"100px\" width=\"70px\"/></a></p>
100 <div style=\"border-bottom:solid;border-bottom-width:2px;border-bottom-color:#f2b234;height:1px;width:570px;margin-top:8px;margin-bottom:10px;\"></div>
101 <p><a href=\"http://www.facebook.com/YourNextRead/\"><img src=\"http://www.buttonshut.com/Facebook-Buttons/Facebook-Buttons-42-32-.gif\" border=\"0\"/></a> <a href=\"http://www.twitter.com/YourNextRead\" ><img src=\"http://www.twitterbuttons.com/upload/badges/02bb9f0627follow-us-1.gif\" border=\"0\"/></a><a style=\"float:right;margin-top:20px;\" href=\"http://www.amazon.com/?tag=bookwhack-20\" ><img src=\"http://g-ecx.images-amazon.com/images/G/01/gno/images/general/navAmazonLogoFooter._V169459313_.gif\" border=\"0\"/></a><br/></p>
102 </td>
103 </tr>
104 </tbody>
105 </table>
106 </td>
107 </tr>
108
109 <tr>
110 <td colspan=\"3\" bgcolor=\"#232323\"><br>
111 <font face=\"arial, verdana, sans-serif\" color=\"#ffffff\" size=\"1\" style=\"font-size:10px;\">
112 Terms and Conditions
113 <br><br>
114 This is a genuine email from <span style=\"border-bottom-style: dashed; border-bottom-width: 1px; border-bottom-color: rgb(0, 102, 204); cursor: pointer; \">YourNextRead</span>. However, if you receive an email which you are concerned does not legitimately originate from us, you can report it via <a rel=\"nofollow\" target=\"_blank\" href=\"mailto:feedback@yournextread.com\" style=\"color:#ffffff;\"><span class=\"yshortcuts\">emailing us</span></a> before deleting it.
115 <br><br>
116 You have received this email because you have opted in to receive news, updates and offers from YourNextRead
117 <br><br>
118 You can <a rel=\"nofollow\" target=\"_blank\" href=\"http://www.yournextread.com/user/unsubscribe.php?email=$email\" style=\"color:#ffffff;\"><span>unsubscribe here</span></a>, however as the majority of our communications are via email, you'll be missing out.
119 <br>
120 </font>
121 </td>
122 </tr>
123
124 </tbody></table>
125
126
127 </td></tr></tbody></table></html>";
128
129 $header="from: YourNextRead <newsletter@yournextread.com>\nContent-Type: text/html; charset=iso-8859-1";
130 $to=$email;
131 $subject="Even More Book Ideas!";
132 $sentmail = mail($to,$subject,$message,$header);
133 fwrite($fh, "$email\n");
134 }
135
136 }
137
138 sleep(60);
139 }
140 fwrite($fh, "COMPLETE");
141 fclose($fh);