Advertisement
Guest User

Untitled

a guest
Oct 20th, 2017
659
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.26 KB | None | 0 0
  1. <?php
  2. /*
  3. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  4. "http://www.w3.org/TR/html4/loose.dtd">
  5. <html>
  6. <head>
  7. <title>Re: Aprende Online Como hacer Plan Social Media paso a paso</title>
  8. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  9. </head>
  10. <!-- <body onLoad="window.location.reload()"> -->
  11. <body>
  12. */
  13. ?>
  14. <?php
  15.  
  16. set_time_limit(0);
  17. function microtime_float()
  18. {
  19. list($usec, $sec) = explode(" ", microtime());
  20. return ((float)$usec + (float)$sec);
  21. }
  22.  
  23. $mailtext = ' <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  24. <html xmlns="http://www.w3.org/1999/xhtml">
  25. <head>
  26. <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
  27. <title>Re: Te apuntas al webinar de Facebook Ads e Instagram?</title>
  28. <div style="text-size-adjust: auto; margin: 0px; outline: none; padding: 0px;">
  29. <p style="color: rgb(93, 93, 93); font-family: Arial;"><span style="color: rgb(51, 51, 51); font-size: 14px; font-weight: inherit; line-height: inherit; text-decoration: inherit; font-family: verdana, arial, sans;">&iquest;Qu&eacute; tal se presenta el d&iacute;a? </span><br />
  30. <br />
  31. <span style="color: rgb(51, 51, 51); font-size: 14px; font-weight: inherit; line-height: inherit; text-decoration: inherit; font-family: verdana, arial, sans;">Por si no has podido ver mis &uacute;ltimos correos, vengo a decirte que el </span><b style="margin: 0px; outline: none; padding: 0px; color: rgb(51, 51, 51); font-family: verdana, arial, sans; font-size: 14px;">pr&oacute;ximo jueves 26 de octubre, de 17:00 a 19:00</b><span style="color: rgb(51, 51, 51); font-size: 14px; font-weight: inherit; line-height: inherit; text-decoration: inherit; font-family: verdana, arial, sans;"> (hora Madrid &ndash; Espa&ntilde;a) </span><b style="margin: 0px; outline: none; padding: 0px; color: rgb(51, 51, 51); font-family: verdana, arial, sans; font-size: 14px;">&nbsp;vamos a ofrecer un webinar en directo</b><span style="color: rgb(51, 51, 51); font-size: 14px; font-weight: inherit; line-height: inherit; text-decoration: inherit; font-family: verdana, arial, sans;">&nbsp;para nuestros usuarios. (Si no puedes venir te mandaremos la grabaci&oacute;n, la documentaci&oacute;n y el Diploma a tu nombre).</span><br />
  32. <br />
  33. <span style="color: rgb(51, 51, 51); font-size: 14px; font-weight: inherit; line-height: inherit; text-decoration: inherit; font-family: verdana, arial, sans;">Durante 2 horas te contaremos los secretos de </span><b style="margin: 0px; outline: none; padding: 0px; color: rgb(51, 51, 51); font-family: verdana, arial, sans; font-size: 14px;">Facebook Adseme (e Instagram)</b><span style="color: rgb(51, 51, 51); font-size: 14px; font-weight: inherit; line-height: inherit; text-decoration: inherit; font-family: verdana, arial, sans;">, el m&eacute;todo m&aacute;s eficaz </span><b style="margin: 0px; outline: none; padding: 0px; color: rgb(51, 51, 51); font-family: verdana, arial, sans; font-size: 14px;">para atraer suscriptores, conseguir clientes y generar ventas sin necesidad de tener un blog</b><span style="color: rgb(51, 51, 51); font-size: 14px; font-weight: inherit; line-height: inherit; text-decoration: inherit; font-family: verdana, arial, sans;">, tener que escribir como un loco todas las semanas y perder un mont&oacute;n de horas en las redes sociales. </span><br />
  34. <br />
  35. <span style="color: rgb(51, 51, 51); font-size: 14px; font-weight: inherit; line-height: inherit; text-decoration: inherit; font-family: verdana, arial, sans;">En SocialBlaBla nos hemos convertido en el Portal l&iacute;der de Social Media en espa&ntilde;ol, y queremos ense&ntilde;arte c&oacute;mo lo hemos conseguido en Facebook, con estos puntos:</span></p>
  36.  
  37. <p style="color: rgb(93, 93, 93); font-family: Arial;">&nbsp;</p>
  38.  
  39. <ul style="color: rgb(51, 51, 51); font-family: verdana, arial, sans; margin: 0px 0px 0px 40px; padding-right: 0px; padding-left: 0px; font-size: 14px;">
  40. <li style="box-sizing: border-box; line-height: 26px; margin-left: 21px;">Introducci&oacute;n a Facebook Ads</li>
  41. <li style="box-sizing: border-box; line-height: 26px; margin-left: 21px;">C&oacute;mo es la plataforma de Facebook Ads</li>
  42. <li style="box-sizing: border-box; line-height: 26px; margin-left: 21px;">C&oacute;mo crear anuncios en Facebook</li>
  43. <li style="box-sizing: border-box; line-height: 26px; margin-left: 21px;">Las audiencias en Facebook</li>
  44. <li style="box-sizing: border-box; line-height: 26px; margin-left: 21px;">C&oacute;mo captar suscriptores con Facebook</li>
  45. <li style="box-sizing: border-box; line-height: 26px; margin-left: 21px;">Todo sobre Facebook Pixel</li>
  46. <li style="box-sizing: border-box; line-height: 26px; margin-left: 21px;">C&oacute;mo crear anuncios en Instagram</li>
  47. <li style="box-sizing: border-box; line-height: 26px; margin-left: 21px;">Power Editor para Facebook &amp; Instagram Ads</li>
  48. <li style="box-sizing: border-box; line-height: 26px; margin-left: 21px;">C&oacute;mo vender con anuncios de Facebook</li>
  49. <li style="box-sizing: border-box; line-height: 26px; margin-left: 21px;">Tips y hacks para anuncios en Facebook e Instagram</li>
  50. <li style="box-sizing: border-box; line-height: 26px; margin-left: 21px;">Anal&iacute;ticas en Facebook</li>
  51. </ul>
  52.  
  53. <p style=""><font face="verdana, arial, sans"><span style="font-size: 14px;">Y mucho m&aacute;s...</span></font></p>
  54.  
  55. <h2 style="font-style:italic;"><br style="color: rgb(51, 51, 51); font-family: verdana, arial, sans; font-size: 14px;" />
  56. <a href="https://www.socialblabla.com/taller-en-vivo-sobre-facebook-ads-e-instagram.html" target="_blank"><span style="font-size: inherit; font-weight: inherit; line-height: inherit; text-decoration: inherit;">&gt;&gt;Quiero reservar mi plaza ahora &lt;&lt;</span></a></h2>
  57. </div>
  58.  
  59. <h2 style="font-style:italic;"><br />
  60. <span style="color: rgb(51, 51, 51); font-size: 14px; font-weight: inherit; line-height: inherit; text-decoration: inherit; font-family: verdana, arial, sans;">Recuerda que tenemos s&oacute;lo 100 plazas, as&iacute; que hazlo ahora y as&iacute; te aseguras de que no te quiten la tuya ;)</span><br />
  61. <br />
  62. <a href="https://www.socialblabla.com/taller-en-vivo-sobre-facebook-ads-e-instagram.html" target="_blank"><span style="font-size: inherit; font-weight: inherit; line-height: inherit; text-decoration: inherit;">&gt;&gt;Reserva tu plaza ahora para el webinar &lt;&lt;</span></a></h2>
  63. ';
  64.  
  65. $mails = array("mjrgranja@hotmail.com",
  66. "factoria@gmail.com");
  67.  
  68. /*
  69. $mails = array("holamundo@aaffnfetwork.hn.org",");
  70. $mails = array("webmfaster@mensajeitor.com");
  71. $mails = array("webmafster@mensajeitor.com",
  72. echo count($mails)." Mails<br>";
  73. */
  74. $testing = false;
  75. $left = 0;
  76.  
  77. $numPerIt = 2500;
  78.  
  79. do {
  80.  
  81. if(!$testing) {
  82.  
  83. $wlink = mysqli_connect("localhost","wtmailer","password");
  84. mysqli_select_db("administracion",$wlink);
  85. if($left == 0) {
  86. $left = mysqli_result(mysql_query("SELECT count(*) FROM wtmailer WHERE enviado = 0",$wlink),0);
  87. } else {
  88. $left -= $numPerIt;
  89. }
  90. //$result = mysql_query("SELECT * FROM usuarios WHERE enviado = 0 LIMIT 100",$wlink);
  91. $result = mysqli_query("SELECT * FROM wtmailer WHERE enviado = 0 ORDER BY SUBSTRING_INDEX(mail,'@',-1) LIMIT $numPerIt",$wlink);
  92. echo "Sending... $left mails left\n";
  93. $time_start = microtime_float();
  94. while($row = mysql_fetch_array($result)) {
  95. $mail = $row['mail'];
  96. $status = mail($mail, "RE: Te apuntas al webinar de Facebook Ads e Instagram?", $mailtext, "From: info@socialblabla.com\nContent-type: text/html\nReturn-Path: info@socialblabla.com\n","-finfo@socialblabla.com");
  97. if($status) {
  98. $update = 1;
  99. }
  100. else {
  101. $update = -1;
  102. }
  103. mysql_query("UPDATE wtmailer SET enviado = '$update',fechaenvio = NOW() WHERE id = '{$row['id']}'",$wlink);
  104. }
  105. } else {
  106. echo "Testing...\n";
  107. $time_start = microtime_float();
  108. foreach($mails as $mail) {
  109. mail($mail,"RE: Te apuntas al webinar de Facebook Ads e Instagram?",$mailtext,"From: info@socialblabla.com\nContent-type: text/html\nReturn-Path: info@socialblabla.com\n","-finfo@socialblabla.com");
  110. }
  111. $left = 0;
  112. }
  113. $time_end = microtime_float();
  114. $time = $time_end - $time_start;
  115.  
  116. echo "Ha tardado $time segundos - Estimado ".round((($left/$numPerIt)*$time)/3600,2)." \n";
  117.  
  118. } while($left > 0);
  119.  
  120. ?>
  121. </body>
  122. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement