yii2-swiftmailer icon indicating copy to clipboard operation
yii2-swiftmailer copied to clipboard

SwiftMailer delivery status

Open yii-bot opened this issue 7 years ago • 0 comments

This issue has originally been reported by @mogilka at https://github.com/yiisoft/yii2/issues/15545. Moved here by @samdark.


Why Yii2 Mailer uses SwiftMailer but ignores its failed recipients feature?

What steps will reproduce the problem?

Swift_Mailer class method send($message, $failedRecipients = null) has two parameters: message (requires) and failedRecipients (not required)

But yii\swiftmailer\Mailer calls send() method without parameter failedRecipients:

$this->getSwiftMailer()->send($message->getSwiftMessage()) > 0;

So it's impossible to detect if a mail delivery was success. For example, if incorrect email address used

What is the expected result?

I want to use all accessable SwiftMailer features, particularly "failedRecipients" parameter to get a list of email addresses which delivery process failed. So I want to have a posibility to check not only send() method result but also an array of recipients who did not receive the message - via native SwiftMailer variable "failedRecipients"

What do you get instead?

Default mailer settings and simplified send() method works perfect if it's no nessessary to check email delivery. But in most cases it is not enough and misleading that the recipient has received a message. There are no other ways to check this at the program level

Additional info

Q A
Yii version 2.0.8
PHP version 7.0.26
Operating system Ubuntu 16.04

yii-bot avatar Jan 23 '18 15:01 yii-bot