Code: Select all
<?php
ini_set('display_errors', '1');
error_reporting(E_ALL);
require_once ("swift/Swift.php");
require_once ("swift/Swift/Connection/Sendmail.php");
//Try to connect using /usr/sbin/sendmail -bs
#$swift =& new Swift(new Swift_Connection_Sendmail());
//Try to connect using a custom command
$swift =& new Swift(new Swift_Connection_Sendmail("/usr/sbin/sendmail -t"));
//Create the message
$message =& new Swift_Message("My subject", "My body");
if ($swift->send($message, "to@domain.com", "from@domain.net")) {
echo "Message sent";
} else {
echo "Message failed to send";
}
//It's polite to do this when you're finished
$swift->disconnect();
?>PHP = 4.4.7
Swift Mailer = 3.3.2 for php4
Thanks,
Chuck.