Mail.php - newbie question
| From: | Oscar Karlsson | Date: | Fri, 24 Sep 2004 14:02:29 +0000 |
| Subject: | Mail.php - newbie question | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-14613@lists.php.net to get a copy of this message | ||
Hi there!
I tried this simple mail example script and got the following error:
Fatal error: Cannot redeclare class mail in /customers/lzr.se/lzr.se/httpd.www/includes/Mail.php on line 33
Anyone have any suggestions?
Regards
<html>
<title>test</title>
<body>
<?php
ini_set("include_path", '/customers/lzr.se/lzr.se/httpd.www/includes/' . PATH_SEPARATOR . ini_get("include_path"));
require_once 'PEAR.php';
require_once 'Mail.php';
include('Mail.php');
define('MYCLASS_ERROR_CODE', 1);
PEAR::setErrorHandling(PEAR_ERROR_TRIGGER, E_USER_WARNING);
$recipients = 'lzr@home.se';
$headers['From'] = 'lzr@home.se'; $headers['To'] = 'lzr@home.se';$headers['Subject'] = 'Test2 message'; $body = 'Test message'; $params['sendmail_path'] = '/usr/sbin/sendmail'; // Create the mail object using the Mail::factory method $mail_object =& Mail::factory('sendmail', $params); $mail_object->send($recipients, $headers, $body); ?> </body> </html>