Skip to content

Commit 32786b7

Browse files
committed
bug swiftmailer#385 NullTransport should report that all emails have been delivered. (michaldudek)
This PR was merged into the 5.2-dev branch. Discussion ---------- NullTransport should report that all emails have been delivered. The PHPDoc for ```NullTransport``` says: > Pretends messages have been sent, but just ignores them. However it returns ```0``` from ```send()``` method saying that no mail has been delivered. It should return number of recipients. Commits ------- 157ca16 NullTransport should report that all emails have been delivered.
2 parents 564abb1 + 157ca16 commit 32786b7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/classes/Swift/Transport/NullTransport.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,13 @@ public function send(Swift_Mime_Message $message, &$failedRecipients = null)
7373
$this->_eventDispatcher->dispatchEvent($evt, 'sendPerformed');
7474
}
7575

76-
return 0;
76+
$count = (
77+
count((array) $message->getTo())
78+
+ count((array) $message->getCc())
79+
+ count((array) $message->getBcc())
80+
);
81+
82+
return $count;
7783
}
7884

7985
/**

0 commit comments

Comments
 (0)