[ Index ]
 

Code source de eZ Publish 3.9.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/ezutils/classes/ -> ezfiletransport.php (source)

   1  <?php
   2  //
   3  // Definition of eZFileTransport class
   4  //
   5  // Created on: <10-Dec-2002 14:41:22 amos>
   6  //
   7  // SOFTWARE NAME: eZ publish
   8  // SOFTWARE RELEASE: 3.9.0
   9  // BUILD VERSION: 17785
  10  // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS
  11  // SOFTWARE LICENSE: GNU General Public License v2.0
  12  // NOTICE: >
  13  //   This program is free software; you can redistribute it and/or
  14  //   modify it under the terms of version 2.0  of the GNU General
  15  //   Public License as published by the Free Software Foundation.
  16  //
  17  //   This program is distributed in the hope that it will be useful,
  18  //   but WITHOUT ANY WARRANTY; without even the implied warranty of
  19  //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20  //   GNU General Public License for more details.
  21  //
  22  //   You should have received a copy of version 2.0 of the GNU General
  23  //   Public License along with this program; if not, write to the Free
  24  //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  25  //   MA 02110-1301, USA.
  26  //
  27  //
  28  
  29  /*! \file ezsendmailtransport.php
  30  */
  31  
  32  /*!
  33    \class eZFileTransport ezfiletransport.php
  34    \brief Sends the email message to a file.
  35  
  36  */
  37  
  38  include_once ( 'lib/ezutils/classes/ezmailtransport.php' );
  39  include_once ( 'lib/ezfile/classes/ezfile.php' );
  40  
  41  class eZFileTransport extends eZMailTransport
  42  {
  43      /*!
  44       Constructor
  45      */
  46      function eZFileTransport()
  47      {
  48      }
  49  
  50      /*!
  51       \reimp
  52      */
  53      function sendMail( &$mail )
  54      {
  55          $ini =& eZINI::instance();
  56          $sendmailOptions = '';
  57          $emailFrom = $mail->sender();
  58          $emailSender = $emailFrom['email'];
  59          if ( !$emailSender || count( $emailSender) <= 0 )
  60              $emailSender = $ini->variable( 'MailSettings', 'EmailSender' );
  61          if ( !$emailSender )
  62              $emailSender = $ini->variable( 'MailSettings', 'AdminEmail' );
  63          if ( !eZMail::validate( $emailSender ) )
  64              $emailSender = false;
  65  
  66          $isSafeMode = ini_get( 'safe_mode' );
  67          if ( $isSafeMode and
  68               $emailSender and
  69               $mail->sender() == false )
  70              $mail->setSenderText( $emailSender );
  71          
  72          $filename = mktime() . '-' . rand() . '.mail';
  73          
  74          $data = preg_replace('/(\r\n|\r|\n)/', "\r\n", $mail->headerText() . "\n" . $mail->body() );
  75          return eZFile::create( $filename, 'var/log/mail', $data );
  76      }
  77  }
  78  
  79  ?>


Généré le : Sat Feb 24 10:30:04 2007 par Balluche grâce à PHPXref 0.7