Skip to content

SwiftMailer delivery status #59

@yii-bot

Description

@yii-bot

This issue has originally been reported by @mogilka at yiisoft/yii2#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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions