Actual Delivered Report

Karim Nadi

New Member
Hello,

is there any addon/option or method to get the actual delivered emails that's really landing into recipient mailbox.

thanks
 
Hello,

You can do this with some custom code, for example, if you create a file named init-custom.php in the apps folder, with this content:
PHP:
<?php

Yii::app()->hooks->addAction('delivery_server_after_send_email', function($params, $server, $sent){
    if (!$sent) {
       return;
    }
    $message  = $server->getMailer()->getEmailMessage($params);
    $filePath = '/tmp/' . $server->getMailer()->getEmailMessageId() . '.eml';
    @file_put_contents($filePath, $message);
});
This will write absolutely all emails that go out in the /tmp folder with the .eml extension.
This will affect performance seriously, so use it only for debugging purposes then remove it.
Also, code not tested, sorry.
 
Back
Top