TYPO3 API  SVNRelease
SimpleMailInvoker.php
Go to the documentation of this file.
00001 <?php
00002 
00003 /*
00004  Invokes the mail() function in Swift Mailer.
00005 
00006  This program is free software: you can redistribute it and/or modify
00007  it under the terms of the GNU General Public License as published by
00008  the Free Software Foundation, either version 3 of the License, or
00009  (at your option) any later version.
00010 
00011  This program is distributed in the hope that it will be useful,
00012  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  GNU General Public License for more details.
00015 
00016  You should have received a copy of the GNU General Public License
00017  along with this program.  If not, see <http://www.gnu.org/licenses/>.
00018 
00019  */
00020 
00021 //@require 'Swift/Transport/MailInvoker.php';
00022 
00023 /**
00024  * This is the implementation class for {@link Swift_Transport_MailInvoker}.
00025  *
00026  * @package Swift
00027  * @subpackage Transport
00028  * @author Chris Corbyn
00029  */
00030 class Swift_Transport_SimpleMailInvoker implements Swift_Transport_MailInvoker
00031 {
00032 
00033   /**
00034    * Send mail via the mail() function.
00035    *
00036    * This method takes the same arguments as PHP mail().
00037    *
00038    * @param string $to
00039    * @param string $subject
00040    * @param string $body
00041    * @param string $headers
00042    * @param string $extraParams
00043    *
00044    * @return boolean
00045    */
00046   public function mail($to, $subject, $body, $headers = null, $extraParams = null)
00047   {
00048     if (!ini_get('safe_mode'))
00049     {
00050       return mail($to, $subject, $body, $headers, $extraParams);
00051     }
00052     else
00053     {
00054       return mail($to, $subject, $body, $headers);
00055     }
00056   }
00057 
00058 }