Page 1 of 1

Multiple Emails Being Sent

Posted: Thu Mar 06, 2008 6:27 pm
by allthenations
I just installed the latest version of Swift (PHP5) and I did the smoke test with SMTP, along with my own coded tests, and I keep receiving multiple test emails approximately every 10 minutes. It's as if the script is still running.

Any ideas?

Re: Multiple Emails Being Sent

Posted: Thu Mar 06, 2008 8:45 pm
by Chris Corbyn
What were your own tests? Can we see the code?

Re: Multiple Emails Being Sent

Posted: Thu Mar 06, 2008 9:15 pm
by allthenations
//Load in the files we'll need
require_once "lib/Swift.php";
require_once "lib/Swift/Connection/SMTP.php";

//Start Swift
$smtp =& new Swift_Connection_SMTP("mail.allthenations.org", 25);
$smtp->setUsername("blog@allthenations.org");
$smtp->setpassword("password");

$swift =& new Swift($smtp);

$body = "This is the test message.";

//Create the message
$message =& new Swift_Message("My subject", "$body");

$recipients =& new Swift_RecipientList();
$recipients->addTo("allthenations@gmail.com", "Chris Davis"); //We can give a name along with the address
$recipients->addTo("chrisphone@allthenations.org");

//Now check if Swift actually sends it
if ($swift->send($message, $recipients, "blog@allthenations.org")) echo "Sent";

else echo "Failed";