pls help parse error with swift mailer
Posted: Sun Aug 31, 2008 10:12 pm
Hi, i was trying to test swift mailer on my server using the following codes. I didn't edit anything in Swift.php i just simply copied and pasted the lib folder and rename it to swift into my webserver
require_once $lib_dir."swift/Swift.php";
require_once $lib_dir."swift/Switch/Connection/Sendmail.php";
//Start Swift
$swift =& new Swift(new Swift_Connection_Sendmail());
//Create the message
$message =& new Swift_Message("My subject", "My body");
//Now check if Swift actually sends it
if ($swift->send($message, "sendee.com", "sender.com")) {
echo "Sent";
}
else{
echo "Failed";
}
i got this error
Parse error: syntax error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/yvette/public_html/rjs2/libs/swift/Swift.php on line 36
require_once $lib_dir."swift/Swift.php";
require_once $lib_dir."swift/Switch/Connection/Sendmail.php";
//Start Swift
$swift =& new Swift(new Swift_Connection_Sendmail());
//Create the message
$message =& new Swift_Message("My subject", "My body");
//Now check if Swift actually sends it
if ($swift->send($message, "sendee.com", "sender.com")) {
echo "Sent";
}
else{
echo "Failed";
}
i got this error
Parse error: syntax error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/yvette/public_html/rjs2/libs/swift/Swift.php on line 36