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

Source for file template_phpmailer.php

Documentation is available at template_phpmailer.php

  1. <?php
  2. /**
  3.  * @package linea21.core
  4.  * @subpackage mail
  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. // necessary for loops
  12. if(!in_array(SITE_PATH.'/class/system/class.phpmailer.php'get_included_files()))
  13.     include_once("../class/system/class.phpmailer.php");
  14.  
  15. $mail new phpmailer();
  16.  
  17. if(defined('MAIL_PORT')) $mail->Port MAIL_PORT;
  18.  
  19. if (defined('MAIL_MAILER')) {
  20.     $mail->Mailer MAIL_MAILER;
  21.     if(MAIL_MAILER=='sendmail'{
  22.         if(defined('MAIL_SENDMAIL')) $mail->Sendmail MAIL_SENDMAIL;
  23.     }
  24.     if(MAIL_MAILER=='smtp'{
  25.         if(defined('MAIL_HOST')) $mail->Host MAIL_HOST;
  26.  
  27.     }
  28. }
  29.  
  30. if (defined('MAIL_SMTP_AUTH'&& MAIL_SMTP_AUTH == true{
  31.     $mail->SMTPAuth MAIL_SMTP_AUTH;
  32.     if (defined('MAIL_SMTP_USER')) $mail->Username MAIL_SMTP_USER;
  33.     if (defined('MAIL_SMTP_PASS')) $mail->Password MAIL_SMTP_PASS;
  34. }
  35.  
  36. /**
  37.  echo "destinataire : ".$email_recipient."<br />";
  38.  echo "sujet : ".$email_subject."<br />";
  39.  echo "body : ".$email_html_body."<br />";
  40.  echo "methode : ".$email_method."<br />";
  41.  echo "host : ".$mail->Host."<br />";
  42.  echo "port : ".$mail->Port."<br />";
  43.  */
  44. $mail->SetLanguage('en');
  45. $mail->CharSet CHARSET;
  46. isset($email_from$mail->From $email_from $mail->From MAIL_FROM;
  47. isset($email_fromname$mail->FromName $email_fromname $mail->FromName MAIL_FROMNAME;
  48. $mail->Subject $email_subject;
  49. $mail->WordWrap 75;
  50. $mail->Body $email_html_body;
  51. $mail->AltBody str_replace('&amp;''&'$email_text_body);
  52. $mail->AddReplyTo(MAIL_REPLYMAIL_REPLYNAME);
  53.  
  54. if(is_array($email_recipient)) {
  55.     
  56.     for($i=0$i<count($email_recipient)$i++{
  57.  
  58.         $mail->AddAddress($email_recipient[$i]);
  59.         $r $mail->Send();
  60.         logfile(LOG_MAILERarray($mail->Subject$email_recipient$mail->ErrorInfo));
  61.         if(!$r && MOD_DEBUG == 1{
  62.             _debug('<b>Mail has not been sent</b>. mail->ErrorInfo : ' $mail->ErrorInfo);
  63.         }
  64.  
  65.         $mail->ClearAddresses();
  66.         $mail->ClearAttachments();
  67.  
  68.     }
  69. else {
  70.  
  71.     $mail->AddAddress($email_recipient);
  72.     $r $mail->Send();
  73.     logfile(LOG_MAILERarray($mail->Subject$email_recipient$mail->ErrorInfo));
  74.     if(!$r && MOD_DEBUG == 1{
  75.         _debug('<b>Mail has not been sent</b>. mail->ErrorInfo : ' $mail->ErrorInfo);
  76.     }
  77.     $mail->ClearAddresses();
  78.     $mail->ClearAttachments();
  79.  
  80. }
  81.  
  82. ?>

Documentation generated on Thu, 20 Mar 2014 16:49:36 +0100 by phpDocumentor 1.4.1