Source for file mail.class.php
Documentation is available at mail.class.php
* 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.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* @author m2mtech <tech@m2m.at>
* @copyright 2007 m2m server software gmbh
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License Version 2
* @version $Id: mail.class.php 138 2007-08-29 12:13:55Z m2mtech $
* @link http://www.ea-geier.at/
* attention: might have been defined already in
* config/config.php or code/config.php
define('eaSWIFT_DIR', '3party/swift/Swift-3.1.3-php4/lib');
define('SWIFT_ABS_PATH', eaSWIFT_DIR);
require_once(eaSWIFT_DIR . '/Swift.php');
* load swift connection library
require_once(eaSWIFT_DIR . '/Swift/Connection/SMTP.php');
* constructor of mail wrapper
* defines the environmental settings
* @param string server address
* @param integer server port (25)
function eaMail($server, $port = 25) {
$connection = new Swift_Connection_SMTP($server, $port);
Swift_Errors::expect($e, 'Swift_Connection_Exception'); // before 3.3
Swift_Errors::expect($e, 'Swift_ConnectionException');
$this->error = $e->getMessage();
$this->_swift = & new Swift($connection);
$this->error = 'message object missing';
* @param string body text
$this->error = 'message object missing';
* @param string email address
function to($address, $name = '') {
* carbon-copy recipient setup
* @param string email address
function cc($address, $name = '') {
* @param string email address
function bcc($address, $name = '') {
* @param string email address
function from($address, $name = '') {
$this->_from = & new Swift_Address($address, $name);
$this->error = 'message object missing';
$this->error = 'subject missing';
$this->error = 'body missing';
$this->error = 'recipients missing';
$this->error = 'sender address missing';
|