Location: PHPKode > projects > Private Message System > pmsys-2.3.0/includes/functions_mail.php
<?php

/******************************************************************
* $Id: functions_mail.php,v 1.11 2003/10/22 17:27:02 allowee Exp $
*
* Copyright (C) 2001-2003 PMS Dev Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA  02111-1307, USA.
*
* The "GNU General Public License" (GPL) is available at
* http://www.gnu.org/copyleft/gpl.html.
******************************************************************/


function mailer($to, $subject, $message, $headers = '') {
global $use_smtp;

if ( $use_smtp ) {
    include_once ("./includes/smtp.php");
    $mail = new smtp;
    $mail->smtpmail($to, $subject, $message, $headers);
    
    if ( $mail->mail_error == 'Yes' ) {
       return FALSE;
    } else {
       return TRUE;
    }
    
} else {

    if ( !mail($to, $subject, $message, $headers) ) {
       return FALSE;
    } else {
       return TRUE;
    }
    
}

}
// End mailer() function

?>
Return current item: Private Message System