S
S
Sergey2017-11-03 13:49:20
gmail
Sergey, 2017-11-03 13:49:20

How to send email in yii2 with read receipt via gmail?

I use Yii to send mail via gmail:

Yii::$app->set('mailer', [
            'class' => 'yii\swiftmailer\Mailer',
            'transport' => [
                'class' => 'Swift_SmtpTransport',
                // Values from db
                'class' => 'Swift_SmtpTransport',
                'host' => 'smtp.gmail.com',
                'username' => $username,
                'password' => $password,
                'port' => '587',
                'encryption' => 'tls',
            ],
        ]);

There is a task to learn an amount of the viewed letters.
In Gmail, you can send an email with a read receipt.
Is it possible to send it via mailer in yii2?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Osher, 2017-11-03
@butteff

In Gmail, you can send an email with a read receipt.

As far as I remember, this is only in corporate mail.
You can create a unique ID for each letter and insert a 1x1 image
<img src="/api/markAsRead?accessToken=xxx&user=yyy&emailId=zzz">

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question