Xataface Email Module  0.3.2
Email/Mailmerge Module for Xataface
 All Data Structures Files Functions Variables Pages
mail-unix.php
Go to the documentation of this file.
1 <?php
2 
3 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
4  * *
5  * XPertMailer is a PHP Mail Class that can send and read messages in MIME format. *
6  * This file is part of the XPertMailer package (http://xpertmailer.sourceforge.net/) *
7  * Copyright (C) 2007 Tanase Laurentiu Iulian *
8  * *
9  * This library is free software; you can redistribute it and/or modify it under the *
10  * terms of the GNU Lesser General Public License as published by the Free Software *
11  * Foundation; either version 2.1 of the License, or (at your option) any later version. *
12  * *
13  * This library is distributed in the hope that it will be useful, but WITHOUT ANY *
14  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A *
15  * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU Lesser General Public License along with *
18  * this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, *
19  * Fifth Floor, Boston, MA 02110-1301, USA *
20  * *
21  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
22 
23 /* Purpose:
24  - send a mail message using 'SendMail' Unix program
25 */
26 
27 // manage errors
28 error_reporting(E_ALL); // php errors
29 define('DISPLAY_XPM4_ERRORS', true); // display XPM4 errors
30 
31 // path to 'MAIL.php' file from XPM4 package
32 require_once '../MAIL.php';
33 
34 // initialize MAIL class
35 $m = new MAIL;
36 // set from address
37 $m->From('me@myaddress.net');
38 // optional, set return-path
39 // $m->Path('my@address.net');
40 // add to address
41 $m->AddTo('client@destination.net');
42 // set subject
43 $m->Subject('Hello World!');
44 // set text message
45 $m->Text('Text message.');
46 
47 // optional, you can change the execution program for 'sendmail', by default is '/usr/sbin/sendmail'
48 // $m->SendMail = '/path-to/your-mail-program';
49 // send mail using 'SendMail' Unix program, or type 'qmail' to select 'QMail' program
50 echo $m->Send('sendmail') ? 'Mail sent !' : 'Error !';
51 
52 // optional, print History for debugging
53 print_r($m->History);
54 
55 ?>