I use swiftmailer version Swift-3.3.2-php5
I want to enable logging to catch the failed addresses.
Code: Select all
<?
require_once "lib/Swift.php";
require_once "lib/Swift/Connection/SMTP.php";
$swift =& new Swift(new Swift_Connection_SMTP("localhost"));
$log =& Swift_LogContainer::getLog();
$log->setLogLevel(4);
echo '<pre>' . htmlentities($log->dump(true)) . '</pre>';
$message =& new Swift_Message("My subject", "My body");
$recipients =& new Swift_RecipientList();
$recipients->addTo("aaa@qq q.it");
$recipients->addTo("xxx@yy y.it");
$num_sent = $swift->send($message, $recipients, "me@my-domain.com");
echo "Message sent to $num_sent of 2 recipients";
echo "Failed recipients:<br />";
echo implode(" ,", $log->getFailedRecipients());
?>this is result:
++ Log level changed to 4
Message sent to 2 of 2 recipientsFailed recipients:
where is the prblem, an error
thanks
Bobo