pls help parse error with swift mailer

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
yvettesio
Forum Newbie
Posts: 1
Joined: Sun Aug 31, 2008 10:03 pm

pls help parse error with swift mailer

Post by yvettesio »

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
User avatar
andyhoneycutt
Forum Contributor
Posts: 468
Joined: Wed Aug 27, 2008 10:02 am
Location: Idaho Falls

Re: pls help parse error with swift mailer

Post by andyhoneycutt »

the error you are receiving says that the problem is in swift.php, so it may do some good to post the contents of that here, or at least a few lines around line 36 from that file.

-Andy
Post Reply