EasySwift.php

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
cupaball
Forum Commoner
Posts: 85
Joined: Sun Feb 12, 2006 1:46 pm

EasySwift.php

Post by cupaball »

Okay, I know that I am noob but this thing is discouraging. I guess you have to know a little (really alot) about how to set up the test TestConfiguration.php to run the test. I gave up on that and tried to run EasySwift.php. Right out the gate I get

Code: Select all

Parse error: parse error, unexpected ')', expecting '(' in /home/content/m/a/l/malikhaynes/html/lib/EasySwift.php on line 18
So let the help begin.

All I wanted to do was send an html email to every in my MySQL database using php and I continue to fail miserably. (I've already tried phpmailer).
cupaball
Forum Commoner
Posts: 85
Joined: Sun Feb 12, 2006 1:46 pm

Post by cupaball »

then I tried to send an email and got

Code: Select all

Parse error: parse error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/content/m/a/l/malikhaynes/html/lib/Swift.php on line 35
here is the code from email (copy and paste from example)

Code: Select all

<?php
 
//Load in the files we'll need
require_once "lib/Swift.php";
require_once "lib/Swift/Connection/NativeMail.php";
 
$swift =& new Swift(new Swift_Connection_NativeMail("-f%s"));
 
//Create the message
$message =& new Swift_Message("My subject", "My body");
 
//Now check if Swift actually sends it
if ($swift->send($message, "foo@bar.tld", "mhaynes@aminahdesigns.com")) echo "Sent";
else echo "Failed";

?>
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

You've got the PHP5 version when you need the PHP4 version ;)
cupaball
Forum Commoner
Posts: 85
Joined: Sun Feb 12, 2006 1:46 pm

Post by cupaball »

oh! Okay thanks.
cupaball
Forum Commoner
Posts: 85
Joined: Sun Feb 12, 2006 1:46 pm

Post by cupaball »

I went back and got the files for php.

I can even get past running the test

error

Code: Select all

Warning: main(../lib/Swift/Swift.php): failed to open stream: No such file or directory in /home/content/m/a/l/malikhaynes/html/tests/smokes/components/Runner.php on line 7

Warning: main(../lib/Swift/Swift.php): failed to open stream: No such file or directory in /home/content/m/a/l/malikhaynes/html/tests/smokes/components/Runner.php on line 7

Fatal error: main(): Failed opening required '../lib/Swift/Swift.php' (include_path='.:/usr/local/lib/php') in /home/content/m/a/l/malikhaynes/html/tests/smokes/components/Runner.php on line 7
Post Reply