Xataface Email Module 0.2
Email/Mailmerge Module for Xataface
lib/XPM/EXAMPLES/mail-local.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    - set text message
00025    - send mail using local MTA support (function mail() from php)
00026    - print result
00027 */
00028 
00029 // manage errors
00030 error_reporting(E_ALL); // php errors
00031 define('DISPLAY_XPM4_ERRORS', true); // display XPM4 errors
00032 
00033 // path to 'MAIL.php' file from XPM4 package
00034 require_once '../MAIL.php';
00035 
00036 // initialize MAIL class
00037 $m = new MAIL;
00038 // set from address
00039 $m->From('me@myaddress.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 // send mail
00048 echo $m->Send() ? 'Mail sent !' : 'Error !';
00049 
00050 ?>
 All Data Structures Files Functions Variables Enumerations