linea21-modules
[ class tree: linea21-modules ] [ index: linea21-modules ] [ all elements ]

Source for file x7iYhD98w_sendmail.php

Documentation is available at x7iYhD98w_sendmail.php

  1. <?php
  2. /**
  3.  * @package linea21.modules
  4.  * @subpackage newsletter
  5.  * @author linea21 <info@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  */
  10.  
  11. /**
  12. * LogMailing()
  13. @param string $string 
  14. @return void 
  15. */
  16. function LogMailing($string)
  17. {
  18.     $fp @fopen(LOG_MAILING'a');
  19.     @fwrite($fp$string);
  20.     @fwrite($fpEND_LINE);
  21.     @fclose($fp);
  22.  
  23. include_once('../config/define.php');
  24. include_once('../config/server.php');
  25. include_once('../class/class.newsletter.php');
  26. include_once('../class/system/class.'.SQL.'.php');
  27. include_once("../lib/lib_common.php");
  28. include_once("../lib/functions_auth.php");
  29. include_once(SQL '.inc.php');
  30.  
  31. set_time_limit(0)// suppression du timeout
  32.  
  33. $sql_entity SQL;
  34. $sql_object new $sql_entity;
  35. $sql_object->DBInitialise();
  36. $sql_object->DBConnexion();
  37. // sélection des newsletters à envoyer
  38. $newsletters $sql_object->DBSelect(SQL_GetNewsletter2Send());
  39. if (count($newsletters<= && $newsletters[0== falseexit;
  40.  
  41. // récupération des emails
  42. $emails_batch $sql_object->DBSelect(SQL_GetEmails4Sending());
  43.  
  44. if (count($emails_batch== && $emails_batch[0== falseexit;
  45.  
  46. $newsletter_object new newsletter;
  47.  
  48. $path $newsletter_object->URI_TEMPLATE;
  49.  
  50. // html
  51. $template_html file_get_contents($path '.html');
  52. // text
  53. $template_txt file_get_contents($path '.txt');
  54.  
  55.  
  56. $log_sep='##';
  57.  
  58. require("../mail/template_newsletter.php");
  59.  
  60.  
  61. ?>

Documentation generated on Fri, 16 Oct 2009 09:40:15 +0200 by phpDocumentor 1.4.1