2
私は(http://swiftmailer.org/docs/sending.htmlから)このコードをしようとしているとして、バウンスを取得しません:
require_once 'lib/swift_required.php';
//Create the Transport
$transport = Swift_SmtpTransport::newInstance('localhost', 25);
//Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);
//Create a message
$message = Swift_Message::newInstance('Wonderful Subject')
->setFrom(array('[email protected]' => 'John Doe'))
->setBody('Here is the message itself')
;
//Send the message
$failedRecipients = array();
$numSent = 0;
$to = array('[email protected]', '[email protected]' => 'A name');
foreach ($to as $address => $name)
{
$message->setTo(array($address => $name));
$numSent += $this->send($message, $failedRecipients);
}
printf("Sent %d messages\n", $numSent);
問題は、私が正しい送信されたメールとして認識ではSwiftMailer悪いドメインに電子メールを送信した場合$failedRecipients
は空です。私のメールボックスに私は失敗通知を返しました。
なぜSwiftmailerはこのメールを失敗として認識せず、入力しません$failedRecipients
Array
?
その通り。メールサーバが最初にメッセージを受け入れるなら、SwiftMailer(または他のライブラリ)ができることは何もありません。 –