[SOLVED] Trying to get SwiftMailer Working...
Posted: Wed Mar 07, 2007 2:33 pm
Looks like a handy little library.. but am having some difficulty getting it to work.
Getting this error:
Parse error: parse error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/user/public_html/swiftlib/Swift.php on line 34
I uploaded "swift" (previously 'lib') folder to /public_html/ and am using the following modified code from the "simple email tutorial":
Using PHP 4.4.4.
File including code above is located in /public_html/testmail/ ... thus the ../swift/ path traversal is correct.
Any ideas what is going on here? Thanks.
Getting this error:
Parse error: parse error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/user/public_html/swiftlib/Swift.php on line 34
I uploaded "swift" (previously 'lib') folder to /public_html/ and am using the following modified code from the "simple email tutorial":
Code: Select all
//Load in the files we'll need
require_once ('../swift/Swift.php');
require_once ('../swift/Swift/Connection/SMTP.php');
//Start Swift
$swift =& new Swift(new Swift_Connection_SMTP("smtp.mysite.com"));
//Create the message
$message =& new Swift_Message("My subject", "My body");
//Now check if Swift actually sends it
if ($swift->send($message, "me@mysite.com", "me2@mysite.com")) echo "Sent";
else echo "Failed";
File including code above is located in /public_html/testmail/ ... thus the ../swift/ path traversal is correct.
Any ideas what is going on here? Thanks.