00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 class eZMailTransport
00041 {
00042
00043
00044
00045 function eZMailTransport()
00046 {
00047 }
00048
00049
00050
00051
00052
00053
00054 function sendMail( &$mail )
00055 {
00056 if ( get_class( $mail ) != 'ezmail' )
00057 {
00058 eZDebug::writeError( 'Can only handle objects of type eZMail.', 'eZMailTransport::sendMail' );
00059 return false;
00060 }
00061 return false;
00062 }
00063
00064
00065
00066
00067
00068 function send( &$mail )
00069 {
00070 if ( get_class( $mail ) != 'ezmail' )
00071 {
00072 eZDebug::writeError( 'Can only handle objects of type eZMail.', 'eZMailTransport::send' );
00073 return false;
00074 }
00075 $ini =& eZINI::instance();
00076
00077 $transportType = trim( $ini->variable( 'MailSettings', 'Transport' ) );
00078 $transportObject =& $GLOBALS['eZMailTransportHandler_' . strtolower( $transportType )];
00079 if ( !isset( $transportObject ) or
00080 !is_object( $transportObject ) )
00081 {
00082 $transportClassFile = 'ez' . strtolower( $transportType ) . 'transport.php';
00083 $transportClassPath = 'lib/ezutils/classes/' . $transportClassFile;
00084 $transportClass = 'eZ' . $transportType . 'Transport';
00085 if ( !file_exists( $transportClassPath ) )
00086 {
00087 eZDebug::writeError( "Unknown mail transport type '$transportType', cannot send mail",
00088 'eZMailTransport::send' );
00089 return false;
00090 }
00091 include_once( $transportClassPath );
00092 if ( !class_exists( $transportClass ) )
00093 {
00094 eZDebug::writeError( "No class available for mail transport type '$transportType', cannot send mail",
00095 'eZMailTransport::send' );
00096 return false;
00097 }
00098 $transportObject = new $transportClass();
00099 }
00100 return $transportObject->sendMail( $mail );
00101 }
00102 }
00103
00104 ?>