yiisoft / yii2-swiftmailer

Yii 2 swiftmailer extension.
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
116 stars 74 forks source link

SwiftMailer delivery status #59

Open yii-bot opened 6 years ago

yii-bot commented 6 years ago

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