1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403
| <?php
session_start();
include("../mysqlcon.php");
$selectf = "Select * from commande WHERE news='1' UNION Select * from newsletter WHERE news='1'";
$reqf = $conn->query($selectf);
while($f = mysqli_fetch_array($reqf)){
$boundary = md5(rand());
$select = "SELECT * from commercant where valide='1' ORDER BY rand() LIMIT 1,100000000000";
$req = $conn->query($select);
while($data = mysqli_fetch_array($req)){
$promotion = $data["promotion"]."<br>";
$nomcommerce = $data["nomcommerce"]."<br>";
$tel = $data["tel"];
$adresse = $data["adressep"];
}
$promotion = nl2br($promotion);
$nomcommerce = nl2br($nomcommerce);
$adressep = nl2br($adressep);
$prenom = $f["prenom"];
$iduser = $f["id"];
$numerocarte = $f["numerocarte"];
$passuser = $f["pass"];
$validation = $f["validation"];
$email = $f["email"];
$pseudo = $f["pseudo"];
if (!preg_match("#^[a-z0-9._-]+@(hotmail|live|msn).[a-z]{2,4}$#", $email)) // On filtre les serveurs qui rencontrent des bogues.
{
$passage_ligne = "\r\n";
}
else
{
$passage_ligne = "\n";
}
//=====Déclaration des messages au format texte et au format HTML.
$message_html = '<html xmlns="https://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,300,700,600" rel="stylesheet" type="text/css">
<head>
<!--[if gte mso 12]>
<style type="text/css">
[a.btn {
padding:15px 22px !important;
display:inline-block !important;
}]
</style>
<![endif]-->
<style type="text/css">
div, p, a, li, td {
-webkit-text-size-adjust:none;
}
.ReadMsgBody {
width: 100%;
background-color: #d1d1d1;
}
.ExternalClass {
width: 100%;
background-color: #d1d1d1;
line-height:100%;
}
.distri {
border: 1px solid;
text-align: center;
margin-bottom: 5px;
}
body {
width: 100%;
height: 100%;
background-color: #d1d1d1;
margin:0;
padding:0;
-webkit-font-smoothing: antialiased;
-webkit-text-size-adjust:100%;
}
html {
width: 100%;
}
img {
-ms-interpolation-mode:bicubic;
}
table[class=full] {
padding:0 !important;
border:none !important;
}
table td img[class=imgresponsive] {
width:100% !important;
height:auto !important;
display:block !important;
}
@media only screen and (max-width: 800px) {
body {
width:auto!important;
}
table[class=full] {
width:100%!important;
}
table[class=devicewidth] {
width:100% !important;
padding-left:20px !important;
padding-right: 20px!important;
}
table td img.responsiveimg {
width:100% !important;
height:auto !important;
display:block !important;
}
}
@media only screen and (max-width: 640px) {
table[class=devicewidth] {
width:100% !important;
}
table[class=inner] {
width:100%!important;
text-align: center!important;
clear: both;
}
table td a[class=top-button] {
width:160px !important;
font-size:14px !important;
line-height:37px !important;
}
table td[class=readmore-button] {
text-align:center !important;
}
table td[class=readmore-button] a {
float:none !important;
display:inline-block !important;
}
.hide {
display:none !important;
}
table td[class=smallfont] {
border:none !important;
font-size:26px !important;
}
table td[class=sidespace] {
width:10px !important;
}
}
@media only screen and (max-width: 520px) {
}
@media only screen and (max-width: 480px) {
table {
border-collapse: collapse;
}
table td[class=template-img] img {
width:100% !important;
display:block !important;
}
}
@media only screen and (max-width: 320px) {
}
</style>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="full">
<tr>
<td align="center"><table width="600" border="0" cellspacing="0" cellpadding="0" align="center" class="devicewidth">
<tr>
<td><table width="100%" bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="0" align="center" class="full" style="background-color:#ffffff;">
<tr>
<td height="23"> </td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="23" class="sidespace"> </td>
<td><table width="76%" border="0" cellspacing="0" cellpadding="0" align="left" class="inner" id="banner" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;">
<tr>
<td style="font:bold 27px Arial, Helvetica, sans-serif; border-right:1px solid #dbdbdb;" class="smallfont">Information T\'ES DE MURET</td>
</tr>
<tr>
<td height="20"> </td>
</tr>
</table>
<table width="22%" border="0" cellspacing="0" cellpadding="0" align="right" class="inner" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;">
<tr>
<td align="center"><a href="https://www.facebook.com/groups/1383840451862587/" style="margin-top:5px; display:inline-block;"><img src="https://www.tesdemuret.fr/mail/images/facebook.png" width="32" height="atuo" alt="Social Media" /></a></td>
</tr>
<tr>
<td height="20"> </td>
<td height="20"> </td>
<td height="20"> </td>
</tr>
</table></td>
<td width="23" class="sidespace"> </td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="3.33%" class="sidespace"> </td>
<td width="93.33%"><img class="imgresponsive" src="https://www.tesdemuret.fr/mail/images/couvtdm.jpg" width="554" height="atuo" alt="Banner" /></td>
<td width="3.33%" class="sidespace"> </td>
</tr>
<tr>
<td height="20"> </td>
<td height="20"> </td>
<td height="20"> </td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="23" class="sidespace"> </td>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="left" class="inner">
<tr>
<td style="font:14px/19px Arial, Helvetica, sans-serif; color:#333332;">
<div class="top-button" style="text-align: center; font:bold 13px/37px Arial, Helvetica, sans-serif; color:#ffffff; text-decoration:none; background:#16c4a9; display:block; border-radius:24px; text-transform:uppercase;">Bonjour '.$prenom.'</div>
Aujourd\'hui <b>'.$nomcommerce.'</b> te propose ses services, en effet ce commerçant te proposes en ce moment:<p> <b>'.$promotion.'</b><p> c\'est génial n\'est ce pas ? <p>
Réserve vite au <b>'.$tel.'</b> et rends toi vite dans sa boutique situé <b>'.$adresse.'</b>
<p>
| Ton numéro de carte <b>'.$numerocarte.'</b> |<p>
| T\'es identifiants sont : <br>
Identifiant : <b>'.$email.'</b><br>
Mot de Passe : <b>Seulement vous qui le connaissez</b> |<p>
Connecte toi vite à ton espace onglet <b>"La carte tdm & application"</b> puis <b>"Accés Membre"</b><p>
<b>
Désormais tu peux maintenant rejoindre l\'association TDM sur www.tesdemuret.fr en cliquant sur l\'onglet "L\'Association" puis "Nous rejoindres" trop cool hein ?
</b><p>
<P>
Si tu n\'as pas reçu ta carte tu peux la récupérer chez un de nos distributeurs suivant : <p>
';
$select = "SELECT * from commercant where distribution = 1 and valide = 1";
$req = $conn->query($select);
while($data = mysqli_fetch_array($req)){
$promotion = $data["promotion"];
$nomcommercee = $data["nomcommerce"];
$tele = $data["tel"];
$adressee = $data["adressep"];
$message_html .='<div class="distri"><b>'.$nomcommercee.'</b> situé à l\'adresse <b>'.$adressee.'</b> contact : <b>'.$tele.'</b></div>';
}
$message_html .='
<i>Tu ne souhaites plus recevoir l\'offre de nos partenaires ? C\'est dommage mais tu peux annuler ton abonnement en cliquant : <a href =\'https://www.tesdemuret.fr/nonews.php?email='.$email.'&iduser='.$iduser.'\'>>>> ICI <<<</a></i></p>
Si tu ne vois pas le lien copie/colle celui-ci dans ton navigateur https://www.tesdemuret.fr/nonews.php?email='.$email.'&iduser='.$iduser.'<p>
<P>
Cordialement<br>
Alain Paltou <br>
Support TDM<br>
<p></td>
</tr>
<tr>
<td height="20"> </td>
</tr>
</table></td>
<td width="23" class="sidespace"> </td>
</tr>
<tr>
<td height="16"> </td>
<td height="16"> </td>
<td height="16"> </td>
</tr>
</table></td>
</tr>
<tr>
<td style="border-bottom:1px solid #dbdbdb;"> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
';
//==========
//=====Création de la boundary
$boundary = "-----=".md5(rand());
//==========
//=====Définition du sujet.
$sujet = "Partenaire du jour";
$sujet = nl2br($sujet);
//=========
//=====Création du header de l'e-mail.
$adresse_exp = "contact@tesdemuret.fr";
$adresse_exp2 = "tesdemuret@gmail.com";
$header = "From: \"Support TDM\"<$adresse_exp>".$passage_ligne;
$header.= "Reply-to: \"Support TDM\" <$adresse_exp2>".$passage_ligne;
$header.= "MIME-Version: 1.0".$passage_ligne;
$header .= "X-Priority: 1".$passage_ligne;
$header.= "Content-Type: multipart/alternative;".$passage_ligne." boundary=\"$boundary\"".$passage_ligne;
//==========
//=====Création du message.
$message = $passage_ligne."--".$boundary.$passage_ligne;
//=====Ajout du message au format texte.
$message.= "Content-Type: text/plain; charset=\"UTF_8\"".$passage_ligne;
$message.= "Content-Transfer-Encoding: 8bit".$passage_ligne;
$message.= $passage_ligne.$message_txt.$passage_ligne;
//==========
$message.= $passage_ligne."--".$boundary.$passage_ligne;
//=====Ajout du message au format HTML
$message.= "Content-Type: text/html; charset=\"UTF-8\"".$passage_ligne;
$message.= "Content-Transfer-Encoding: 8bit".$passage_ligne;
$message.= $passage_ligne.$message_html.$passage_ligne;
//==========
$message.= $passage_ligne."--".$boundary."--".$passage_ligne;
$message.= $passage_ligne."--".$boundary."--".$passage_ligne;
//==========
//=====Envoi de l'e-mail.
if(mail($email,$sujet,$message,$header)){
echo("mail envoyer à $email");
} else {
echo("erreur");
}
//==========
}
?> |
Partager