failures does not work
Posted: Tue Jan 12, 2010 7:42 am
I can not see any failures in the response (no message at all), although recieved mail: Delivery to the following recipient failed permanently:
xxx@zzdadas.gg
It does not work with methods batchSend and Send.
May be someone could help?
Version SwiftMailer 4.0.5
Here is my code:
<?php
require_once '../inc/Swift/lib/swift_required.php';
ini_set('display_errors', 1);
$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, 'ssl')
->setUsername('realemail@gmail.com')
->setPassword('password')
;
//print_r ($transport);
$mailer = Swift_Mailer::newInstance($transport);
$message = Swift_Message::newInstance('Wonderful Subject')
->setFrom(array('realmail@gmail.com' => 'John Doe'))
//->setTo($answer)
->setTo(array('goodmail@good.com', 'xxx@zzdadas.gg' => 'A name'))
->setBody('Here is the message itself')
;
$logger = new Swift_Plugins_Loggers_EchoLogger();
$mailer->registerPlugin(new Swift_Plugins_LoggerPlugin($logger));
echo $logger->dump();
if (!$mailer->batchSend($message, $failures))
{
echo "Failures:";
print_r($failures);
}
?>
Thanks in advance!!!
xxx@zzdadas.gg
It does not work with methods batchSend and Send.
May be someone could help?
Version SwiftMailer 4.0.5
Here is my code:
<?php
require_once '../inc/Swift/lib/swift_required.php';
ini_set('display_errors', 1);
$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, 'ssl')
->setUsername('realemail@gmail.com')
->setPassword('password')
;
//print_r ($transport);
$mailer = Swift_Mailer::newInstance($transport);
$message = Swift_Message::newInstance('Wonderful Subject')
->setFrom(array('realmail@gmail.com' => 'John Doe'))
//->setTo($answer)
->setTo(array('goodmail@good.com', 'xxx@zzdadas.gg' => 'A name'))
->setBody('Here is the message itself')
;
$logger = new Swift_Plugins_Loggers_EchoLogger();
$mailer->registerPlugin(new Swift_Plugins_LoggerPlugin($logger));
echo $logger->dump();
if (!$mailer->batchSend($message, $failures))
{
echo "Failures:";
print_r($failures);
}
?>
Thanks in advance!!!