Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezfiletransport.php
Go to the documentation of this file.
1 <?php
17 class eZFileTransport extends eZMailTransport
18 {
19 function sendMail( eZMail $mail )
20 {
21 $ini = eZINI::instance();
22 $sendmailOptions = '';
23 $emailFrom = $mail->sender();
24 $emailSender = $emailFrom['email'];
25 if ( !$emailSender || ( is_array( $emailSender ) && count( $emailSender) <= 0 ) )
26 $emailSender = $ini->variable( 'MailSettings', 'EmailSender' );
27 if ( !$emailSender )
28 $emailSender = $ini->variable( 'MailSettings', 'AdminEmail' );
29 if ( !eZMail::validate( $emailSender ) )
30 $emailSender = false;
31
32 $filename = time() . '-' . mt_rand() . '.mail';
33
34 $data = preg_replace('/(\r\n|\r|\n)/', "\r\n", $mail->headerText() . "\n" . $mail->body() );
35 $returnedValue = eZFile::create( $filename, 'var/log/mail', $data );
36 if ( $returnedValue === false )
37 {
38 eZDebug::writeError( 'An error occurred writing the e-mail file in var/log/mail', __METHOD__ );
39 }
40
41 return $returnedValue;
42 }
43 }
44
45 ?>
eZDebug\writeError
static writeError( $string, $label="", $backgroundClass="")
Definition: ezdebug.php:545
eZFileTransport
Sends the email message to a file.
Definition: ezfiletransport.php:18
eZFileTransport\sendMail
sendMail(eZMail $mail)
Definition: ezfiletransport.php:19
eZFile\create
static create( $filename, $directory=false, $data=false, $atomic=false)
Definition: ezfile.php:41
eZMailTransport
Interface for mail transport handling.
Definition: ezmailtransport.php:18
eZMail
Mail handler.
Definition: ezmail.php:60
eZMail\headerText
headerText( $parameters=array())
Definition: ezmail.php:1020
eZMail\sender
sender( $convert=true)
Definition: ezmail.php:250
eZMail\body
body( $convert=true)
Definition: ezmail.php:691
eZMail\validate
static validate( $address)
Definition: ezmail.php:747
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.