View Full Version : Need help really bad!


DZINE
05-01-2005, 06:41 AM
I am running this class.SimpleMail.php code and am getting this error.

Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' .SimpleMail.php on line 4

Here is the code for that line.

<?php

class SimpleMail {
public $to = NULL;
public $cc = NULL;
public $bcc = NULL;
public $from = NULL;
public $subject = '';
public $body = '';
public $htmlbody = '';
public $send_text = TRUE;
public $send_html = FALSE;
private $message = '';
private $headers = '';

function send_mail($to = NULL,
$subject = NULL,
$message = NULL,
$headers = NULL) {


What is wrong? I am running it on my hosting sever.

harley
05-02-2005, 09:53 AM
Just because it says there's an error on line 4 doesn't always mean that's where the error occured. Often the parser won't realize the error until it hits the end of the script, like with missing brackets and such.

Check all you { and make sure they have corresponding }, and also that ( have corresponding ). Check that each line is properly ended with a ;

If you're still stuck post the code for the whole file along with the error(s).

sean1
08-21-2005, 05:00 PM
I guess, the code you've been trying is for PHP5 (because of the word public), whereas you are using a PHP4 system. Just replace the public's with var. Hope, it helped.