Page 1 of 1

Mail is sent only once. Need to close connection?

Posted: Thu Nov 15, 2007 6:48 am
by markis1986
Hi i have this, "basic send mail".

When i execute it on my explorer's page - Mail is sent. But when i reexecute it - nothing happens :(
Do i need to close connection? Or is it closed automatically?

Code: Select all

<?php
 
//Load in the files we'll need
require_once "lib/Swift.php";
require_once "lib/Swift/Connection/SMTP.php";
 
//Start Swift
$swiftas =& new Swift(new Swift_Connection_SMTP("smtp_servers_name"));
 
//Create the message
$message =& new Swift_Message("My subject", "Ledo body");
 
//Now check if Swift actually sends it
if ($swiftas->send($message, "Sent-to-mail", "sent-from-mail")) echo "Sent";
else echo "Failed";
 ?>