I have uploaded the Swift mailer software to one of my VS (website)
It is located at http://www.fethiye-guide.com/lib
I have uploaded the php5 version and I am running php5.1
The strange thing is - it completely hangs when trying to process the file.
I don't get any errors - the server just does not do anything with the scripts.
I have written a test mailer script to use the swift library.
This is it:
Actually the first short script calls the main script. - This is to show that the first script is running OK
Code: Select all
<?php
/*
* test-it.php
*
*/
echo "This is test-it.php";
include_once("test-mail.php");
echo "This is test-it.php no. 2";
?>
Code: Select all
<?php
/*
* test-mail.php
*
*
*/
echo "got here email 000 <br>";
$to = "dave.fethiye@gmail.com";
$name = "Dave";
$from = "admin@fethiye-guide.com";
$from_name = "David";
$subjectX = "Please confirm your advert listing.";
echo "got here email 00 <br>";
$messageX = "this is a test message";
echo "got here email 01 <br>";
//Load in the files we'll need
require_once "/lib/Swift.php";
require_once "/lib/Swift/Connection/SMTP.php";
echo "got here email 02 <br>";
//Start Swift
$swift = new Swift(new Swift_Connection_SMTP("localhost"));
echo "got here email 03 <br>";
//Create the message
$message = new Swift_Message($subjectX,$messageX, "text/html");
echo "got here email 04 <br>";
//Now check if Swift actually sends it
if ($swift->send($message, new Swift_Address($to, $name),
new Swift_Address($from, $from_name)){
echo "Sent to $sent recipients";
}
else{
echo "Failed";
} // end else
//It's polite to do this when you're finished
$swift->disconnect();
echo "got here email 05 <br>";
?>
This is test-it.php
You can try yourself at :
http://www.fethiye-guide.com/test-it.php
Any ideas on this ?
Thanks