Finding out Rejected Addresses
It's possible to get a list of addresses that were rejected by the Transport by using a by-reference parameter to send() or batchSend().
As Swift Mailer attempts to send the message to each address given to it, if a recipient is rejected it will be added to the array. You can pass an existing array, otherwise one will be created by-reference.
Collecting the list of recipients that were rejected can be useful in circumstances where you need to "prune" a mailing list for example when some addresses cannot be delivered to.
-
Getting Failures By-reference
Collecting delivery failures by-reference with the send() or batchSend() methods is as simple as passing a variable name to the method call.
Parent topic: Sending Messages
Previous topic: Available Methods for Sending Messages