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";
?>