comparison newsletter/newsletter_110120.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 <= 4000; $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/jan2011.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 20th January 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 Take YourNextRead with you everywhere
65 </font>
66 <br>
67 <font face=\"verdana, sans-serif, arial\" color=\"#232323\" style=\"font-size:12px; font-weight:bold;\">
68 New Mobile Version of YourNextRead.com
69 </font>
70 </td>
71 </tr>
72 </tbody>
73 </table>
74 </td>
75 </tr>
76 <tr></tr>
77 <tr>
78 <td bgcolor=\"#ffffff\" colspan=\"3\">
79 <table width=\"570\" cellpadding=\"10\" cellspacing=\"0\" border=\"0\" bgcolor=\"#ffffff\">
80 <tbody>
81 <tr>
82 <td>
83 <font face=\"verdana, sans-serif, arial\" color=\"#0000000\" style=\"font-size:12px;\"></font>
84 <p style=\"font-family:verdana, sans-serif, arial;font-weight:100;color:#0000000;font-size:13px;line-height:14px;\">
85 Happy Belated New Year!!</p>
86 <p style=\"font-family:verdana, sans-serif, arial;font-weight:100;color:#0000000;font-size:13px;line-height:14px;\">We have been working hard to make YourNextRead easier to use wherever you are and we now have a great new mobile website online! Try it out now on your mobile device by visiting us at <a href=\"http://www.yournextread.com/\">YourNextRead.com</a>.
87 </p>
88 <p style=\"font-family:verdana, sans-serif, arial;font-weight:100;color:#0000000;font-size:13px;line-height:14px;\">With the mobile version you can still recommend books, view Goodreads and Amazon reviews and sign-in to see all of your saved lists. Please send us any <a href=\"mailto:feedback@yournextread.com\">feedback</a> you have, so we can keep improving YourNextRead for you.</p>
89 <div style=\"border-bottom:solid;border-bottom-width:2px;border-bottom-color:#f2b234;height:1px;width:570px;margin-top:8px;margin-bottom:10px;\"></div>
90 </p><p style=\"font-family:verdana, sans-serif, arial;font-weight:100;color:#0000000;font-size:13px;line-height:14px;\">
91 The YourNextRead team wish you all the best for 2011.
92 </p>
93 <p style=\"font-family:verdana, sans-serif, arial;font-weight:100;color:#0000000;font-size:13px;line-height:14px;\">
94 YourNextRead
95 </p>
96
97 <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>
98 <br/></p>
99 <div style=\"border-bottom:solid;border-bottom-width:2px;border-bottom-color:#f2b234;height:1px;width:570px;margin-top:8px;margin-bottom:10px;\"></div>
100
101 </td>
102 </tr>
103 </tbody>
104 </table>
105 </td>
106 </tr>
107
108 <tr>
109 <td colspan=\"3\" bgcolor=\"#232323\"><br>
110 <font face=\"arial, verdana, sans-serif\" color=\"#ffffff\" size=\"1\" style=\"font-size:10px;\">
111 Terms and Conditions
112 <br><br>
113 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.
114 <br><br>
115 You have received this email because you have opted in to receive news, updates and offers from YourNextRead
116 <br><br>
117 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.
118 <br>
119 </font>
120 </td>
121 </tr>
122
123 </tbody></table>
124
125
126 </td></tr></tbody></table></html>";
127
128 $header="from: YourNextRead <newsletter@yournextread.com>\nContent-Type: text/html; charset=iso-8859-1";
129 $to=$email;
130 $subject="Take YourNextRead with you everywhere";
131 $sentmail = mail($to,$subject,$message,$header);
132 fwrite($fh, "$email\n");
133 }
134
135 }
136
137 sleep(60);
138 }
139 fwrite($fh, "COMPLETE");
140 fclose($fh);