Xataface Email Module 0.2
Email/Mailmerge Module for Xataface
lib/XPM/EXAMPLES/mail-unix.php
Go to the documentation of this file.
00001 <?php
00002 
00003 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00004  *                                                                                         *
00005  *  XPertMailer is a PHP Mail Class that can send and read messages in MIME format.        *
00006  *  This file is part of the XPertMailer package (http://xpertmailer.sourceforge.net/)     *
00007  *  Copyright (C) 2007 Tanase Laurentiu Iulian                                             *
00008  *                                                                                         *
00009  *  This library is free software; you can redistribute it and/or modify it under the      *
00010  *  terms of the GNU Lesser General Public License as published by the Free Software       *
00011  *  Foundation; either version 2.1 of the License, or (at your option) any later version.  *
00012  *                                                                                         *
00013  *  This library is distributed in the hope that it will be useful, but WITHOUT ANY        *
00014  *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A        *
00015  *  PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.        *
00016  *                                                                                         *
00017  *  You should have received a copy of the GNU Lesser General Public License along with    *
00018  *  this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, *
00019  *  Fifth Floor, Boston, MA 02110-1301, USA                                                *
00020  *                                                                                         *
00021  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
00022 
00023 /* Purpose:
00024    - send a mail message using 'SendMail' Unix program 
00025 */
00026 
00027 // manage errors
00028 error_reporting(E_ALL); // php errors
00029 define('DISPLAY_XPM4_ERRORS', true); // display XPM4 errors
00030 
00031 // path to 'MAIL.php' file from XPM4 package
00032 require_once '../MAIL.php';
00033 
00034 // initialize MAIL class
00035 $m = new MAIL;
00036 // set from address
00037 $m->From('me@myaddress.net');
00038 // optional, set return-path
00039 // $m->Path('my@address.net');
00040 // add to address
00041 $m->AddTo('client@destination.net');
00042 // set subject
00043 $m->Subject('Hello World!');
00044 // set text message
00045 $m->Text('Text message.');
00046 
00047 // optional, you can change the execution program for 'sendmail', by default is '/usr/sbin/sendmail'
00048 // $m->SendMail = '/path-to/your-mail-program';
00049 // send mail using 'SendMail' Unix program, or type 'qmail' to select 'QMail' program
00050 echo $m->Send('sendmail') ? 'Mail sent !' : 'Error !';
00051 
00052 // optional, print History for debugging
00053 print_r($m->History);
00054 
00055 ?>
 All Data Structures Files Functions Variables Enumerations